Skip to content

How to enable rotation of annotations #524

@bjhowie

Description

@bjhowie

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions