Hi Anand & Micheal,
Thanks a lot for you time and suggestion.
I have tried extracting the coordinates along with the text. The columns in
the PDF table are right aligned (rightly guessed by Micheal) as the data is
numeric. So, instead of (X,Y) I used (X+width, Y) to deal with the right
align issue. However, the (X+width, Y) is not identical for all values in a
column. Following is an example of my table in PDF.
columnA columnB
123.45 8901.9
9.12 72.35
To get the coordinates, I have created a class "TestStrategy" inherited from
base class "LocationTextExtractionStrategy". Following is the override
function in TestStrategy, from which I get the coordinates.
public override void RenderText(TextRenderInfo renderInfo)
{
LineSegment segment = renderInfo.GetBaseline();
//get coordiantes
RectangleJ rect = segment.GetBoundingRectange());
}
Now, rect object will have X,Y and Width (height is always 0). I have also
tried segment.GetStartPoint() and segment.GetEndPoint(), even these values
are not identical for all the values in a column.
Please let me now if this is not the correct way to get the coordinates or I
am missing something. A sample or pseudo code will be of great help.
Thanks,
Bhanu Kota.
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/parse-tabular-data-in-PDF-using-iTextSharp-tp4657013p4657023.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php