Skip to content
Discussion options

You must be logged in to vote

There is a rather hacky way

  1. Extract annotation text
  2. Remove annotations
  3. Extract remaining page text

To remove annotations,

# do either this:
a = page.first_annot
while a:
    a = page.delete_annot(a)

# or this:
doc.xref_set_key(page.xref, "Annots", "null")

This will not change the document permanently if you don't save. Doing doc.close();doc=fitz.open(doc.name) will recycle the document in original state.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hellpanderrr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants