Hi All,
The scenario is I want to convert a PDF file to an xls file. The PDF contains texts and table structures.
It is known that the pdf doesn't have the concept of tables or do have any tags relating to those which may help to figure out that the certain piece of text is in table.
Using ITextSharp we can fetch out individual text and its position information but how to get it with the table structure as the final outcome desired is an excel file. Even if I retrieved text with position information, again placing it in a datatable or to an intermediate html file doesn't seems easy.
Please help me find a suitable solution such as I can create a similar structure that of a PDF file to an xls file. The PDF in this case doesn't have any images, it is only texts and in some cases tables and text in it.
Any help would be really helping.
Loading
Vinay SulankiPosted Oct 13, 2011, 5:21 AM
Thanks for replying.
Hemant KumarPosted Oct 13, 2011, 2:15 AM
I've worked with PDF quite a bit over the years and in my experience this kind of conversion is pointless unless you know exactly how the PDF document is structured. PDF is a layout format; the data in it is optimized for displaying and printing content not for data extraction.
Sure you could extract text from a PDF using some library, but you'll have a hard time figuring out the actual order of the text. To figure that out, you'd have to render the document and determine the position of each piece of text. As far as I know, only commercial PDF libs support this kind of extraction.
OpenOffice has a PDF import extension which you can use to convert to ODF format.
http://wiki.services.openoffice.org/wiki/Pdf_Import_Extension
Then, you can port it over to Excel however you like (i.e. open it in OpenOffice Calc and save as Excel)
Vinay SulankiPosted Oct 12, 2011, 6:09 AM
I think I have to dig more into it further.
Thanks for replying.
TulasiPosted Oct 12, 2011, 5:55 AM
The problem is that the PDF probably does not retain any spreadsheet type structure - its just text drawn on a page. So you are unlikely to happy with the results unless its a really simple page.
http://forums.asp.net/t/1286471.aspx
Vinay SulankiPosted Oct 12, 2011, 5:48 AM
Hemant KumarPosted Oct 12, 2011, 5:44 AM