Inserting the following code somewhere would work
\special{pdf:ann width 3in height 1in
<<
/T (My Signature)
/Subtype /Widget
/FT /Sig
/F 4
/Q 1
/MK << /BC [] >>
>>
}
This is XeLaTeX version of what digsig.sty actually does.
Your issue here has two parts:
- Adding the signature as an image into the letter and
- reducing the space between closing line and name.
Solution point 1: As already mentioned in the other answer you can use command \signature
to place a photographed signatur into your letter after the closing line and before the printed (readable) name:
\signature{\includegraphics[width=4cm]{example-image-a}} % <============
Please see that I used an example image comming from package mwe
, which must be installed but not called ...
Solution point 2: The distance between closing line and following image/name can be controlled for positive values (that means adding more space!) only with
\newlfmP{closeskipafter=0pt} % Skip after closeline before signature image <=================
There is a hard coded new line after the closing line you can only get rid off with patching command \closeline
I did not investigate yet.
So the following mwe
\documentclass[10pt,stdletter,orderfromtodate,sigleft,a4paper]{newlfm}
\usepackage{blindtext, xfrac}
\usepackage{etoolbox}
\usepackage{lmodern}
\makeatletter
\patchcmd{\@zfancyhead}{\fancy@reset}{\f@nch@reset}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyorh}{\f@nch@orh}{}{}
\makeatother
\newlfmP{dateskipbefore=50pt} %
\newlfmP{sigsize=50pt} % Size for written signature
\newlfmP{sigskipbefore=50pt} % Skip between text and closeline
\newlfmP{closeskipafter=50pt} % Skip after closeline before signature image <=================
\newlfmP{Headlinewd=0pt,Footlinewd=0pt}
\namefrom{John Smith}
\addrfrom{%
221B Baker Street\\
London, UK
}
\addrto{%
Basil of Baker Street\\
221$\sfrac{1}{2}$ Baker Street\\
London, UK
}
\dateset{January 6, 1914}
\greetto{To Whom It May Concern,}
\closeline{Sincerely,}
\signature{\includegraphics[width=4cm]{example-image-a}} % <============
\begin{document}
\begin{newlfm}
\blindtext
\end{newlfm}
\end{document}
you get the resulting pdf:
As you can see an example image simulation an hand written signature is added and there is an additional distance a defined with command \newlfmP{closeskipafter=50pt}
.
Change the value in that command to 0pt
to get the minimal possible distance (please note: negative values doe not work!):
Best Answer
You can add scanned PNG image of the signature to Inkscape, vectorize it, then remove PNG image, save the draw as PDF and use it as image in the LaTeX file. Then the menus to save the image disappear. Using the signature as a layer on top of a PNG image, the option to save the image will available again, but only to save the PNG background, simulating some anti-copy mechanism. A trasparent PNG of top of the vectorized also will work in thi sense.
Moreover, making some small modification of the signature (for instance, a very very tiny text inside some trace, invisible without a huge zoom) the screenshot will not reproduce exactly the signature, so it can be checked easily that is not the original, as it will be pixelated after some zoom. However, it can be extracted unaltered with Inkscape, so there are not secure methods, except use also a digital signature.