Python report bbox pyquery within PDF when multiple LTTextLineHorizontal

34 Views Asked by At

I have a PDF file on which I want to report a specific "Contact Name:" text bbox set of coordinates.

I am using pyquery with a kind of statement: pdf.pq('LTTextLineHorizontal:contains("Contact Name:")') Then, I select the coordinates with float(ContactNameLocation.attr('y0')) However, there is multiple "LTTextLineHorizontal" at the same hierarchy level where the text is located.

Contact Name:

Only the first bbox set of coordinates is reported when the text has its bbox at the end. How shall I do to get the last bbox coordinates?

Thanks for your help

0

There are 0 best solutions below