Hi,

I’ve seen this question before in this mail list (namely, https://sourceforge.net/p/podofo/mailman/message/36401779/), but it seems that the discussion just died out in the end.

I had the same issue, and I think I’ve found why the first signature gets invalidated.
`PdfMemDocument::WriteUpdate` method has additional piece of code for rewriting the xref table, and it seems that this change is considered to be a signature violation by Acrobat.
In the previous thread it was mentioned that the signature looks legit in Acrobat 8, but it counts as invalid in later versions. If I recall correctly, in Acrobat 9 the list of allowed actions was reduced greatly, though I can’t find the spec on Adobe website anymore.

For the test, I’ve prepared a document (attached, though not sure if this mail list can handle attachments) which has XRefStream, for which PdfWriter `PrevXRefOffset` would be set to 0 on update. The first signature goes ok, but the second one invalidates the first one. 

Calling Write before processing the PDF removes the XRefStream (or, at least, the HasXRefStream returns False), and both signatures remain valid.

Not sure if it’s parser or writer, it might be that parser finds the first XRefStream and sets the HasXRefStream flag, ignoring the non-stream XRef written by the update.

Attachment: file_with_form.pdf
Description: Adobe PDF document

_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to