Unable to sign a merged document #102
-
I did a simple merger using pyPDF2 and used the same code which worked for a regular pdf. If you can help, it'd be reallly helpful. ` During handling of the above exception, another exception occurred: Traceback (most recent call last): Please help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
For some reason, the AcroForm dictionary in your input file doesn't contain a Fields entry. That's a file format error, and also very bizarre because AcroForm serves no purpose other than managing form fields. The easiest way to work around this particular instance of the problem is to delete the AcroForm entry before letting pyHanko do its thing---assuming you know for sure that all your input files won't contain legitimate form data. Assuming you have the file open in an try:
del my_writer.root['/AcroForm']
except KeyError:
pass Again, it's a workaround, but this is a pretty clear-cut case of bad input. Hope that helps :) |
Beta Was this translation helpful? Give feedback.
For some reason, the AcroForm dictionary in your input file doesn't contain a Fields entry. That's a file format error, and also very bizarre because AcroForm serves no purpose other than managing form fields.
The easiest way to work around this particular instance of the problem is to delete the AcroForm entry before letting pyHanko do its thing---assuming you know for sure that all your input files won't contain legitimate form data. Assuming you have the file open in an
IncrementalPdfFileWriter
, it should suffice to put in something likeAgain, it's a workaround, but this is a pretty clear-cut case of bad input.
Hope tha…