Copy link to clipboard
Copied
Hi guys, i have a trouble with my Pdf Signature.
My Pdf file have two Signatures. You can view my file through this link:
https://drive.google.com/file/d/1TWGBBjU31X3Hc9Z__MPyPlSvh-hnjZrM/view?usp=drive_link
- When i use itext 7 library to verify the signatures in the Pdf file, it all return that both Signatures are VALID.
- I also open this file with Foxit Reader, and it all show me that both Signatures are VALID too.
- But until i open this file with Adobe Acrobat Pro DC (Version: 2021.001.20155). One of two Signature return VALID and the remaining one return INVALID.
I don't know why one of my Signatures is INVALID. Please help me. How can i resovle this ?
Thanks a lot.
Copy link to clipboard
Copied
The issue essentially is the same as in this thread and this thread (and other answers elsewhere referenced from the latter thread): There is a small error in the original version of the document that usually is ignored by PDF viewers (including Acrobat) but that makes Acrobat reject signatures not covering the full document.
The original revision of your document claims to have been generated by Aspose.PDF for .NET 19.3. Aspose PDF components at least since version 11 have had the issue that they created broken object cross reference tables, see for example this thread on the Aspose support forum. There Aspose personal claimed for different 17.x versions that the bug had been fixed but at least for some versions 19.x the bug has been observed again.
The current Aspose.PDF version appears to be a 23.x. Possibly they meanwhile indeed have fixed the issue for good. Thus, you may want to try updating to a current Aspose.PDF version for creation of the original revision. If that doesn't help, consider applying the first signature not as incremental update. As you use iText for signing, that would mean not using append mode when signing un-signed PDFs.
The error in detail:
The cross reference table section of the first revision of your document consists of multiple subsections:
xref
0 41
0000000000 65535 f
...
0000269450 00000 n
46 1
0000373620 00000 n
48 1
0000374603 00000 n
50 195
0000376071 00000 n
...
0000416893 00000 n
247 1
0000417069 00000 n
252 4
0000417224 00000 n
...
0000418281 00000 n
257 18
0000418600 00000 n
...
0000424661 00000 n
277 238
0001114385 00000 n
etc. etc.
Furthermore, there are some object numbers in the applicable range without any mapping, e.g. 41..45, 47, 49.
According to the PDF specification, though, for a PDF file that has never been incrementally updated, the cross-reference section shall contain only one subsection, whose object numbering begins at 0, and the cross-reference table (comprising the original cross-reference section and all update sections) shall contain one entry for each object number from 0 to the maximum object number defined in the PDF file, even if one or more of the object numbers in this range do not actually occur in the PDF file.