Programmatically signed PDF document does not get the green checkmark after being signed using Acrobat Reader

北城余情 提交于 2021-01-07 03:52:58

问题


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:

  1. Signature 1 with Acrobat => ok
  2. Signature 2 with my app => the previous signatures are invalid, but this is ok
  3. Signature 3 with Acrobat => signature 1 is invalid, but 2 and 3 are ok
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!