pdfbox extract text by area units

Viewed 20

I need to extract the address zip code from a pdf and I use the PDFTextStripperByArea class from pdfbox like in this example ExtractTextByArea. But what are the units of parameters in Rectangle rect = new Rectangle( 10, 280, 275, 60 ); From where must measure and to what units? If they are pixels then it is not convenient to measure pdf page component positions in pixels.

1 Answers

The y-coordinates are java coordinates (y == 0 is top), not PDF coordinates (y == 0 is bottom).

The units are 1/72 inch which is identical to pixels when you render the PDF at 100%.

Related