You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Joël Kuiper <jo...@joelkuiper.eu> on 2014/09/02 15:47:35 UTC

Add highlight/annotation to known string of text within a PDF

Hey! 

I’m sure this has been asked before, but I could not find a straight-forward answer. 

The problem is that I have a PDF for which I want to highlight a known string with a color. 
Similar to the way Adobe Reader or Preview allows you to drag the mouse to create an annotation, but in this case I know the string in advance. 
The string can span multiple lines, even in multi-column documents — but can be assumed consecutive within the extracted text. 

Most of the annotation tools need quads (bounding boxes), but I’m unsure how to get those for a arbitrary string. 

Any pointers on this? 

Kind regards, 
Joël 

RE: Add highlight/annotation to known string of text within a PDF

Posted by Jan Tosovsky <j....@email.cz>.
On 2014-09-02 Joël Kuiper wrote:
> 
> The problem is that I have a PDF for which I want to highlight a known
> string with a color.
>

>From what the PDF is produced? It is always better to do this kind of job in the source document.

Jan