Skip to content

page.add_highlight_annot(start=pointa, stop=pointb) not working #2168

Discussion options

You must be logged in to vote

This script is even a bit simpler:

import fitz

doc = fitz.open("test_source.pdf")
for page in doc:
    rl1 = page.search_for("Therapievorschlag")
    if rl1 == []:  # not on page
        continue
    rl2 = page.search_for("EU-Verordnung")
    if rl2 == []:  # not on page
        continue
    pointa = rl1[0].tl
    pointb = rl2[0].br
    page.add_highlight_annot(start=pointa, stop=pointb)

doc.save("test.pdf")

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Comment options

You must be logged in to vote
3 replies
@kalimer00
Comment options

@JorjMcKie
Comment options

@kalimer00
Comment options

Answer selected by kalimer00
Comment options

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

@JorjMcKie
Comment options

@kalimer00
Comment options

@JorjMcKie
Comment options

@kalimer00
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment