Skip to content

Delete (Remove) of highlighted annotation from PDF #2825

Answered by JorjMcKie
Carnegie-eng asked this question in Q&A
Discussion options

You must be logged in to vote

Your code would only delete the responses to an annotation. These are things like PopUp annotation and any thread of text annotations marked as "IRT" ("in response to"). Your intention seems to be the following:

annot = page.first_annot
while annot:
    if annot.type[0] == fitz.PDF_ANNOT_HGIGHLIGHT:
        annot = page.delete_annot(annot)
    else:
        annot = annot.next

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Carnegie-eng
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants