[英]Read data from a PDF document that does not have an XFA-form
I use iText to read a PDF document containing an XFA form. 我使用iText读取包含XFA表单的PDF文档。 I convert it to XML, read data from the XML and insert it in a datatbase.
我将其转换为XML,从XML读取数据并将其插入数据库中。 But if I dont have an XFA form in the PDF then how I can efficiently read data from the PDF?
但是,如果我在PDF中没有XFA表单,那么如何有效地从PDF中读取数据?
It depends on your expectations. 这取决于您的期望。
You can use text extraction to retrieve all the text on a certain page. 您可以使用文本提取来检索特定页面上的所有文本。 How you then process the text is up to you.
然后如何处理文本取决于您。 (eg regular expressions)
(例如正则表达式)
You can also opt for using pdf2Data, an iText7 add-on that allows you to match documents against templates. 您还可以选择使用pdf2Data,这是一个iText7插件,可让您将文档与模板进行匹配。 pdf2Data seems like a good fit, since it produces XML files as its output.
pdf2Data似乎很合适,因为它生成XML文件作为其输出。
More information on pdf2Data can be found here http://itextpdf.com/itext7/pdf2Data 有关pdf2Data的更多信息,请参见http://itextpdf.com/itext7/pdf2Data
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.