Replies: 2 comments
-
You did not mention your PyMuPDF version. In some version, under certain conditions, the first loop version did not ignore invalid entries in the page's Should be resolved now, so both loops should always work with the newest version. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response kind response. I apologize for that very poor problem description. I am using the very latest version 1.21.1 and python 3.9. I have switched over to the 2'nd style which works fine, but I was surprised at the exception. |
Beta Was this translation helpful? Give feedback.
-
I have a loop to iterate the annotations on a given page and then clear them using a loop as shown below. This has always worked for me, but I have encountered a situation where the load_annot() in the fitz library throws the following exception:
"runtimeerror: xref 175 is not an annot of this page"
I then modified this loop to work as follows:
Is this expected behavior? And what is the recommended way to do this? Please note that I am also adding NEW annotations after the annotations are cleared for all pages.
Thanks
Mike
Beta Was this translation helpful? Give feedback.
All reactions