Closed NexPlex closed 2 weeks ago
A bug report cannot be accepted without a reproducing file.
Sorry my bad. See attached. thank you for the quick reply. 003668df-7ea8-4f40-b672-7162f2d1e209-ca-polst-2017-en.pdf
The PDF does contain many errors. It has 39 form fields which all have a wrong entry /AP
.
AP - albeit optional - if present should be correct. As per the specs it must be a PDF dictionary, but it is a string in all cases. Who knows why.
If an AP is missing or unusable, the appearance will be generated from the object definition of the field.
If you are molested by the messages you can request to not show them - use pymupdf.TOOLS.mupdf_display_errors(False)
.
Description of the bug
PyMuPDFb==1.23.3. works fine when we upgrade to PyMuPDFb==1.24.5 these lines of code started throwing an error.
this error repeats about 15 times. but the code save successfully.
I saw a post that suggested we clean the file like this, but it did not change the results.
print('page') page = doc[page_number - 1]
How to reproduce the bug
No errors with PyMuPDFb==1.23.3.
PyMuPDF version
1.24.5
Operating system
Linux
Python version
3.9