You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Robert Pesch <rp...@scai.fraunhofer.de> on 2009/11/06 13:30:59 UTC

PrintImageLocations width/height incorrect?

Dear all,

i have played a bit around with the PrintImageLocation 
(org.apache.pdfbox.examples.util, latest SVN check out) example. For me 
it seems as the computed width and height information are not correct.

As a test case, i printed the locations of the text on a given page and 
the locations of the figures on the same page and my goal was to compute 
the distance between the text and the figure on the page (i want to 
detect figure captions). But what i got was something like that:

Found image[Im1] at 117.8281,525.6248779296875 size=127.62613,127.62613 
(output from the PrintImageLocation example)
Whereas my text starts at (117, 525) (derived from the TextPosition 
objects in the PDFTextStripper).  As you can see, the (x,y) coordinates 
make perfect sense, since i tested it on a page with just one figure and 
a corresponding figure caption. But the width and height information 
(127,127) are a bit strange since the image spans across half the page 
in my example.

I can see that the width and height information are somehow computed 
with respect to the scaling, but i wasn't able to fix the transformation 
myself.

Can anyone validate that the height and width information are weird or 
am I interpreting the coordinates incorrectly?

Many thanks in advance.

With kind regards
Robert