iTextSharp的读表 [英] itextsharp read table

查看:227
本文介绍了iTextSharp的读表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建使用iTextSharp的一个表的PDF文件。我发现一个例子在 http://itextsharp.sourceforge.net/tutorial/ch05.html。现在,我想再次使用iTextSharp的从表中读取数据。我无法找到如何读取该数据的任何文件。有人可以给我一个例子吗?

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 data from the table again using itextsharp. I can't find any documentation on how to read this data. Can someone give me an example?

推荐答案

可惜你不能在iTextSharp的做到这一点。 高级:阅读PDF一节上SourceForge上的iTextSharp的页面说:

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

PDF格式是流向何方
文本和图形都放在没有
的结构信息的画布。作为这样
有不在
的PDF文件中的任何'iText的对象。在每一个页面将有
可能是一些'条件',但
你不能重建一个短语或使用这些字符串一个
款。有
可能是一些画线,
,但你​​不能检索基于这些行的表对象
。简而言之:
解析PDF文件的内容是
用的iText不可能的。发表您的
问题在新闻组
消息://comp.text.pdf,也许你
会得到人们一些答案是
建立了一个可以解析PDF $ B工具$ b,并提取它的一些内容,但
不要指望将执行
防弹转换结构性
的文本工具。

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.

这篇关于iTextSharp的读表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆