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.
c # itextsharp
chengzixiaohai Dec 04 '12 at 12:33 2012-12-04 12:33
source share