Closed loganathanspr closed 1 year ago
Thanks for flagging @loganathanspr! Looking at the stacktrace, my best guess is that the annotation has an undefined bounding box. (Hence why it'd get such an error on line 167, where the stacktrace is pointing.) But it's a bit difficult to know for sure, or to test a fix, without seeing the actual PDF. Are you able to share that?
Hi @loganathanspr, just checking back: Are you able to provide the original PDF?
Hi @jsvine, sorry for coming back so late, unfortunately I am not able to share the pdf. It happens with certain annotations, and it seems to work with PyMuPDF, that's our current workaround. Will share the document if I see that in other places. Thank you!
Thanks, @loganathanspr. Closing this for now, but feel free to reopen if you come across another, shareable PDF that raises similar errors.
Describe the bug
I am extracting annotations from a pdf file. It is giving me the
TypeError
when accessing the.annots
. When I updated each annotations manually (just adding/deleting one extra character ), it didn't give me this error. I am suspecting the original text encoding of the annotation is different than the one expected by thepdfplumber
. Doespdfplumber
have any strict assumption on the text encoding?Code to reproduce the problem
Screenshots
Environment