问题
I have written an application to sign PDF documents and now I am able to sign any non-signed PDF document, and Adobe Reader shows the green checkmark. Moreover I can sign a file with multiple signatures and the results are ok.
But if I try to sign the document using Adobe Reader, when I sign it again, the result is that any signature prior to the last one does not get the green checkmark because Acrobat thinks that the document has changed. Then, if I sign the document again using Adobe Reader and my application, the next signatures get the green marks again. The problem appears with the first adobe signature, but I cannot get the reason.
Workflow:
- Signature 1 with Acrobat => ok
- Signature 2 with my app => the previous signatures are invalid, but this is ok
- Signature 3 with Acrobat => signature 1 is invalid, but 2 and 3 are ok
- Signature 4 with my app => signature 1 is invalid, but 2, 3 and 4 are ok
Could you please help me to identify and correct the problem?
Thank you in advance.
The files:
- the original file
- the file signed by me (it gets the green checkmark)
- the file signed by acrobat (it is correct).
- the file signed by acrobat again (it is correct)
- the file signed by acrobat an me (fails to get the green check mark for the adobe's signed part)
回答1:
You change the AcroForm dictionary DA default appearance entry.
In the document signed by Adobe the AcroForm dictionary looks like this:
<</DA(/Helv 0 Tf 0 g )/DR<</Encoding<</PDFDocEncoding 8 0 R>>/Font<</Helv 6 0 R/MyriadPro-Regular 27 0 R/ZaDb 7 0 R>>>>/Fields[26 0 R]/SigFlags 3>>
After you signed that document it becomes this:
<</DA(/Helv 0 Tf 0 g)/DR<</Encoding<</PDFDocEncoding 8 0 R>>/Font<</Helv 6 0 R/MyriadPro-Regular 27 0 R/ZaDb 7 0 R>>>>/Fields[26 0 R 35 0 R]/SigFlags 3>>
I.e. you removed the trailing space character in the DA entry.
来源:https://stackoverflow.com/questions/64988766/programmatically-signed-pdf-document-does-not-get-the-green-checkmark-after-bein