Get coordinates from pdf using itextsharp

I did something like this:

PdfReader reader = new PdfReader("cde.pdf"); TextWithPositionExtractionStategy S = new TextWithPositionExtractionStategy(); PdfTextExtractor.GetTextFromPage(reader,1,S); Vector curBaseline = renderInfo.GetDescentLine().GetStartPoint(); Vector topRight = renderInfo.GetAscentLine().GetEndPoint(); iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(curBaseline[Vector.I1], curBaseline[Vector.I2], topRight[Vector.I1], topRight[Vector.I2]); string x1 = curBaseline[Vector.I1].ToString(); string x2 = curBaseline[Vector.I2].ToString(); string x3 = topRight[Vector.I1].ToString(); string x4 = topRight[Vector.I2].ToString(); 

But I have the coordinates of the string, not the words. How can I change the code to get the coordinate of a word. Thank.

0
c # itextsharp
Dec 04 '12 at 12:33
source share

No one has answered this question yet.

See similar questions:

3
Get the corresponding coordinates of all words on a page using itextsharp

or similar:

2058
How to get consistent byte representation of strings in C # without manually specifying an encoding?
1658
Get int value from enum in C #
1480
Is there a reason for reusing a C # variable in foreach?
1270
Why not inherit from List <T>?
939
Group in LINQ
874
Enum string representation
721
How would you count occurrences of a string (actually char) inside a string?
342
How to get C # Enum description from value?
fifteen
Getting string coordinates using ITextExtractionStrategy and LocationTextExtractionStrategy in Itextsharp
3
Get the corresponding coordinates of all words on a page using itextsharp



All Articles