开发者

itextsharp read table [closed]

开发者 https://www.devze.com 2022-12-19 00:58 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

Improve this question

I've created a pdf with a table using itextsharp. I found an example at http://itextsharp.sourceforge.net/tutorial/ch05.html. Now I'd like to read dat开发者_如何学Ca from the table again using itextsharp. I can't find any documentation on how to read this data. Can someone give me an example?


Unfortunately you can't do this in iTextSharp. The section entitled "Advanced: reading PDF" on the iTextSharp page at SourceForge says:

The pdf format is just a canvas where text and graphics are placed without any structure information. As such there aren't any 'iText-objects' in a PDF file. In each page there will probably be a number of 'Strings', but you can't reconstruct a phrase or a paragraph using these strings. There are probably a number of lines drawn, but you can't retrieve a Table-object based on these lines. In short: parsing the content of a PDF-file is NOT POSSIBLE with iText. Post your question on the newsgroup news://comp.text.pdf and maybe you will get some answers from people that have built tools that can parse PDF and extract some of its contents, but don't expect tools that will perform a bullet-proof conversion to structured text.


I also need to read the data from the PDF. What I ended up doing was converting the PDF to text and then string parse the result to get to the data.

In my scenario I wanted to take the data in the tables and convert them to Excel.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号