'How to get coordinate of text from line paragraph pdf itext5

How to get coordinate of left of line text paragraph pdf. I mean like pic (x,y). Coordinate per line. I use itext5 and java

enter image description here



Solution 1:[1]

I'm not very familiar with itext, but if you use pdfbox, you can override the writePage method of the PDFTextStripper class. The position of all text is in the member variable "charactersByArticle" of PDFTextStripper class, so you can then get the leftmost coordinate from this variable and use it to minus font size is your need.I guess there are similar classes in itext.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mr.SwiftOak