Thursday, April 19, 2012

Reading a table in PDF Itextsharp

I was trying to read a PDF using Itextsharp in .NET application. I am able to read individual word sccessfully . The challenge I am facing now is reading a table. I have a table structure like this:



enter image description here



Please note that here some of column names are two-lined. for example Department Code and Employee Identification Number.



So my requirement is to read the Employee Identification number and salary if the employee belongs to 'HR' department. For this I have to check whether a column named 'Department Code' exists in the PDF file.



When I read this table using iTextsharp, what happens is let us say 'Department' part of 'Department Code' column comes at poition 1 , but the 'Code' comes 5th position.This is because this column is displayed in two lines and there are other four words exists in the pdf before I read the 'Code'part of this column. I am totally stuck at this :(



Anybody has any idea how to make sure that a column name 'Department Code' exists and read corresponding values from this table.



Appreciate your help!



Regards,
Jaleel





No comments:

Post a Comment