-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
Description
I have a loop that iterates through each annotation on a page and calls a function which modifies both the object dictionary and appearance stream, as per the below example.
for annot in page.annots():
if annot.type[0]==4:
annot.update()
rotate_rect_annot(annot,angle)
The result is that the code gets stuck in an infinite loop, looping over the same annotations over and over. Modifying the object or appearance stream obviously messes with the page.annots() generator. Is there a way to avoid this?
Another thing that is unexpected is that unless i call annot.update() before calling my function, i get a MuPDF error when attempting to update the appearance stream "xref not a stream object".
I'm using v1.16.18