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 <me...@joelkuiper.eu> on 2014/10/02 23:18:48 UTC

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

Hey all,

The code works most of the time, but sometimes the position is off. 
I’m using the Matrix from position.getTextPos() of TextPosition. 

The direction in which the position is sometimes subtle, but sometimes extreme. I’m figuring there is some transformation I’m forgetting to apply. 

What is the proper API for getting the absolute text position from a TextPosition? 

Kind regards, 
Joël 


> On 10 Sep 2014, at 13:12, Joël Kuiper <me...@joelkuiper.eu> wrote:
> 
> I’ve created a new issue [1] as a “wish”. 
> The link to the gist in the comment [2] has slightly cleaner code than previously posted and is in the org.apache.pdfbox.examples.pdmodel namespace 
> 
> And no problem, glad to be useful ;-)
> 
> [1] https://issues.apache.org/jira/browse/PDFBOX-2337
> [2] https://gist.githubusercontent.com/joelkuiper/331a399961941989fec8/raw/9bc1a13eca6577c70c3a309214424cd6b0f2d3e6/TextHighlight