解析 MS Reporting Services 生成的 PDF 文件 - 无 OCR

发布于 2024-10-07 05:47:53 字数 198 浏览 1 评论 0原文

我需要解析 MS Reporting Services 生成的 PDF 报告,并将解析后的数据存储到数据库中。别问为什么,问就是要求。 :=)

这些不是需要OCRed的图像PDF,那么有没有更简单的方法来解析这些文件?是否有任何免费或商业工具可用于此目的?

文件包含报告标题和包含一些数据的表格。重点是解析表和标头中的一些字段(客户 ID、名称等)。

I need to parse PDF reports generated by MS Reporting Services, and store parsed data to database. Don't ask why, it's requirement. :=)

These are not image PDFs that need to be OCRed, so is there a simpler way to parse these files? Is there any tool, free or commercial available for this purpose?

Files contain report header, and a table with some data. Focus is on parsing table and a few fields from header (customer id, name, etc.).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲喜皆因你 2024-10-14 05:47:53

iText (Java) & iTextSharp (c#) 可以使用 PdfTextParser 获取原始文本。它甚至会告诉您每个单词的位置以及当前的图形状态(主要是颜色)。主干版本位于 AGPL 之下。 iTextSharp 的 MPL 版本没有解析器包。

通常,将数据作为“表”提取出来是非常困难的。您必须根据页面上的线条和文本来推测它们的格式/位置。

在极少数情况下,标记内容实际上定义了表、行等,但我还没有遇到过(不是我自己创建的)。

您有我们可以查看的样本吗,以便我们可以为您提供更详细的答案?

iText (Java) & iTextSharp (c#) can get you the raw text using PdfTextParser. It'll even tell you where each word is and the current graphic state (color mostly). The trunk releases are under the AGPL. MPL versions of iTextSharp do not have the parser package.

It's VERY difficult to pull data out as "tables"... usually. You have to divine their format/location based on the lines and text on the page.

There are rare cases of Marked Content that actually defines tables, rows, and so forth, but I have yet to encounter one (that I didn't create myself).

Do you have a sample we could look at so we can give you a more detailed answer?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文