hyperref icon indicating copy to clipboard operation
hyperref copied to clipboard

Support for signature fields

Open maxnoe opened this issue 1 year ago • 1 comments

It would be great if hyperref could support a \SignatureField for digital signatures.

There is some "prior art", see https://tex.stackexchange.com/questions/51090/how-do-i-create-a-pdf-file-that-can-be-digitally-signed

But I didn't find a working solution for me (digsig doesn't render in tests I did, neither in Adobe Acrobat nor in Okular) and eforms seems to be incompatible with hyperref forms.

maxnoe avatar Mar 20 '24 12:03 maxnoe

eforms should work find with hyperref, but without example I can't test.

I plan to add some support for signatures to the pdfmanagement-testphase bundle (as addition to l3pdffield,) but I doubt that hyperref itself will get it. Until then you can try something like this

\DocumentMetadata{pdfversion=1.7} %or 2.0

\documentclass[12pt]{report}
\usepackage{l3pdffield-testphase}
\begin{document}
Test signature
\ExplSyntaxOn
\pdffield_field:nn{name=signature,FT=Sig,Q=left}{mysig}
\fbox{\pdffield_annot:n{width=3cm,height=2cm,parent=mysig}}
\ExplSyntaxOff

\end{document}

More keys are in the l3pdffield documentation.

u-fischer avatar Jul 21 '24 16:07 u-fischer

Many thanks for your sample, @u-fischer.

As I’m not a LaTeX user myself, the compiled PDF document from your source helped me to understand how the signature field and widget annotation objects relate to each other (to be able to fix ConTeXt).

@maxnoe, I’m afraid that (even with a perfectly fine PDF document), pdfsig (tool from poppler) or Okular will sign the document wrong (in a way that is incompatible with the PDF spec and wrong). Also MuPDF-GL has the same issue.

I’m afraid poppler is misbehaving here and I‘m report this issue upstream (https://gitlab.freedesktop.org/poppler/poppler/).

ousia avatar Nov 05 '25 16:11 ousia