Dear list,

I‘m testing signature fields with `pdfsig` (to be able to sign them with
“Okular” and “Papers”) and I’m finding a very similar problem to the one
we had with signed fields.

In short, when the signature fields is signed with anything other than
“Acrobat Reader”, neither “Acrobat” or “Edge” (new PDF viewer needs to
enabled first with `edge://flags`) is able to display the signature in
the signed document.

To make things worse, “Acrobat“ offers saving the document, removing the
signature in the output document.

The problem is how the signature field is written. Given the following
sample:

    \nopdfcompression
    \setupinteraction[state=start]
    \setuppapersize[A6, landscape]
    \setuplayout[page]
    \starttext
      \setupfield[sl][horizontal]
        [frame=on, width=1tw, height=1th]
      \definefield[Signature][signature][sl]
      \field[Signature]
    \stoptext

The two objects related to the signature field would read:

    3 0 obj
    << /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 0 rg 0 0 0 RG) /DV () /F 4
    /FT /Sig /Ff 0 /Kids 2 0 R /MaxLen 1024 /Q 0 /Subtype /Widget
    /T (Signature) /V () >>
    endobj
    4 0 obj
    << /Type /Annot /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 0 rg 0 0 0 RG)
    /F 4 /Parent 3 0 R /Q 0 /Subtype /Widget
    /Rect [ 1.685954 1.685954 417.841602 295.951841 ] >>
    endobj

Analyzing the document, veraPDF with the Arlington model
(https://software.verapdf.org/develop/arlington/) warns that annotation
fields cannot have kids.

I see that `lpdf-fld.lmt` contains both functions
`makesignatureparent()` and `makesignaturechild()`. Both the signature
field and the widget annotation have to be a single PDF object.

As for the entries in the signature field dictionary, `/MaxLen` is
exclusive for text fields, not for other kinds of fields.

Also, `/V` and `/DV` should be removed, since default value makes no
sense here and value should be added by the signing software.

As with the signed field, `/NeedAppearances true` needs to be removed
from the final PDF document. Otherwise, “Acrobat” won’t display the
signature in the already signed document.

To show the differences, https://pdf.ousia.tk/acrobat-wrong.pdf is the
signed document with a signature “Acrobat“ cannot display (and removes
the signature, when given the option to save the document).

https://pdf.ousia.tk/acrobat-fine.pdf is my hand-edited version that
“Acrobat” displays perfectly fine.

Could you be so kind to test both documents with “Acrobat” (and “Edge“,
if you are in the mood) to confirm the issue and the potential fixg?

Many thanks for your help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to