Closed msongd closed 10 months ago
Interesting. I haven't tried to repro this yet, but I bet this is the problem: https://github.com/MatthiasValvekens/pyHanko/blob/e13f7c1c803b0ea753a8b34a44f2c12018d79d06/pyhanko/sign/signers/pdf_byterange.py#L73-L78.
The fix should be straightforward, though. Good catch!
Can you try again with the version on the master branch?
Thank you very much. The master branch works now.
Describe the bug When adding digital signature to PDF which is larger than 100 000 000 bytes, pyHanko creates corrupted PDF. It returns success, the file can be viewed normally in Adobe Acrobat Reader, but the digital signature is not shown.
This is the command I used:
Another PDF file having size less than 100 000 000 bytes signed using the same command and cert shows the digital signature normally in Adobe Acrobat Reader.
To Reproduce
Expected behavior Output PDF should show digital signature in Adobe Acrobat Reader.
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Validate bad output PDF file with pdfcpu return this error:
I can provide sample PDF, but it is quite large (100264574 bytes), please advise me how to send the file. A sample 100MB large PDF file from https://testfile.org/all-pdf-sample-test-file-download-direct/ can also be used to trigger this behavior.