如何通过编程生成的PDF找到问题? [英] How can you find a problem with a programmatically generated PDF?

查看:240
本文介绍了如何通过编程生成的PDF找到问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的小组一直在使用itext-sharp库和C#/ .NET生成自定义的动态PDF。在大多数情况下,这个过程非常适合我们的需求。在开发/测试期间我们可能遇到的一个问题是布局问题,这可能导致PDF无法在Adobe Reader中正确打开/呈现,尤其是。较新版本的Acrobat / Reader。



该文档将正确打开前X页的显示。但如果出现错误,文档中的其余页面将不会显示。



如上所述,我们通常能够将此问题跟踪到布局类型问题使用我们的C#/ iText代码。我们最终通过使用猜测和检查方法找到错误,或者分而治之。它有效,但它不是解决这些问题的最佳方法。



我想知道是否有任何可用的工具可以加快验证过程PDF文档,可以帮助指出文档中的错误?

解决方案

验证PDF文件可能是一项非常棘手的任务 - 主要是因为正确执行此操作所需的工具非常昂贵。 / p>

Acrobat有一个工具(高级>预检> PDF分析>报告PDF语法问题),可以扫描PDF以查找任何语法问题,但无法访问该工具以编程方式。



Appligent有一个名为 pdfHarmmony 的工具,由Adobe的PDF库提供支持,可以通过编程方式访问,但价格非常昂贵(2500美元以上)。如果你能负担得起,这个选项可以给你最好的结果。



还有另一种选择 3-Heights PDF Analysis&修复,我不知道它的质量是什么样的,但它同样昂贵。



PDF Validator工具可能会让您感兴趣,但是,它只分析文档结构而不是内容本身,因此损坏的图像或内容流不会被提取。



不幸的是,由于难以详细分析PDF文件,实际上没有任何免费工具可以正常使用,但我想一个检查文档结构的工具总比没有好。


My group has been using the itext-sharp library and C#/.NET to generate custom, dynamic PDFs. For the most part, this process is working great for our needs. The one problem we can run into during development/testing is layout issues which can cause the PDF to not open/render correctly in Adobe Reader, esp. the newer versions of Acrobat/Reader.

The document will open the display correctly for the first X pages. But if there is an error, the remaining pages in the document will not display.

As mentioned, we are usually able to track this problem down to a layout-type issue with our C#/iText code. We eventually find the error by using the guess and check method, or divide and conquer. It works, but it doesn't feel like the best way to solve these problems.

I was wondering if there are any tools available that could speed up the process of validating a PDF document and could help to point out errors in the document?

解决方案

Validating PDF files can be quite a tricky task -- primarily because the tools required to do it properly are very expensive.

Acrobat has a tool (Advanced > Preflight > PDF Analysis > Report PDF syntax issues) that lets you scan a PDF for any syntax issues, but that tool can't be accessed programmatically.

Appligent has a tool called pdfHarmmony, which is powered by Adobe's PDF Library, and can be accessed programmatically, but it is very expensive (US$2500+). This option would give you the best results if you can afford it.

There's another option which is 3-Heights PDF Analysis & Repair, I don't know what it's quality is like, but it is similarly expensive.

This PDF Validator tool on SourceForge might interest you, however, it only analyzes the documents structure and not the content itself, so corrupt images or content streams won't be picked up.

Unfortunately, due to the difficulty of analyzing PDF files in detail, there aren't really any free tools that can do it properly, but I suppose a tool that checks the documents structure is better than nothing.

这篇关于如何通过编程生成的PDF找到问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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