I'm using this library https://github.com/vbuch/node-signpdf to sign a pdf document. After I have signed the document I can see the signature when I open the pdf with Foxit reader but not when I open it with Adobe reader DC. I also tried Adobe reader XI but there I can't see it either.
When I open the document in pdf xchange viewer I get this error: non critical errors detected in the xref table.
Any ideas what the problem could be?
That's the file I signed: https://drive.google.com/file/d/1AZvS4sP2Y3FwW4Deod87Dgxc9I0QZkoc/view?usp=sharing
In your example PDF the name of the signature field consists of 10 bytes, 9 bytes with value 0x00 and one byte with value 0x01. Apparently Adobe Reader does not like that field name.
After some experiments it looks like Adobe Reader does not like a field name starting with a 0x00 byte.
Maybe it contains some code that determines string lengths in a c'ish manner and interprets a 0x00 as end-of-string. A field name with a leading 0x00 byte, therefore, is interpreted as empty string, a field name not accepted by Adobe Reader either.
Thus, please use a signature field name made of (in particular starting with) some meaningful characters. As validators usually display the name of the signature field, this is a good idea anyways.
In terms of lowlevel PDF objects:
The signature field object looks like this:
18 0 obj
<<
/Type /Annot
/Subtype /Widget
/FT /Sig
/Rect [0 0 0 0]
/V 17 0 R
/T ( )
/F 4
/P 1 0 R
>>
endobj
but only like this, the string value of the T entry actually contains the above mentioned nine 0x00 bytes and one 0x01 byte. This is the value that must be changed to a non-empty string not starting with 0x00. I would propose not using bytes < 0x20 at all. Furthermore, the dot, 0x2e, must not be used in the name, it is reserved for separating partial names.