Skip to content

Can we highlight block of text as single highlight? #1055

Answered by JorjMcKie
CR0405 asked this question in Q&A
Discussion options

You must be logged in to vote

Text marker annotations work on the basis of either single rectangles or quads (used in case of non-horizontal stuff), or on a list of such objects.

If a list is used, one text marker is created for all members of the list. But the highlighting (underlining, strikeout, etc.) is visually still the same as if you created separate text markers for each rectangle.

You are free to give any rectangle / quad to page.addHighlightAnnot() - there needs no text at all be contained in it: it could be empty or contain an image ... whatever.
So in your case simply join the line rectangles into one and use the result as argument for annot creation.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1054 on May 18, 2021 12:55.