PDF 大纲文本 - Acrobat 序列自动化
我构建了一个应用程序,可以自动填写 pdf 中的表单字段。然后,它获取各种资产并将它们组合在一起以生成“打印就绪”产品。所有这一切都是使用 iTextSharp 的魔力来完成的。填充表单字段后,它们会被展平为文本。问题是,即使嵌入了字体,它们也没有真正以有意义的方式附加到表单字段(就像直接文本元素一样),并且打印机抱怨 pdf 因此生成许可错误。我对此进行了一些研究,这似乎就是表单字段的本质。
与我们合作的艺术家要求我们研究一种方法来“概述”通过展平表单字段创建的文本。我发现使用自定义预设运行 PDF 优化器可以在 Acrobat 中进行文本大纲,更好的是我可以生成在 pdf 上运行此命令的 Acrobat 序列。问题是序列根本无法自动化。
我发现了一个名为 AutoBatch 的插件,它允许通过批处理文件在命令行上执行序列。缺点是这需要在运行该应用程序的服务器上安装 Acrobat Pro 和插件。此外,仅仅在 pdf 中概述文本似乎是一种过度的解决方案。据我所知,目前 iTextSharp 可能允许我以编程方式执行此操作,但在 google 上搜索此类内容几乎不会返回任何结果,而且没有任何相关内容。
所以问题是:有没有比我当前实施的解决方案更好的方法来概述 pdf 中的文本,或者我有点卡住了?
TLDR; PDF 是使用非标准字体生成的。我需要“概述”此文本以将其发送到打印机。目前使用 AutoBatch Acrobat 插件从命令行执行 Acrobat 序列。似乎有点过分,想知道是否有人知道更好的方法来自动绘制字体轮廓。
I have built an application that automates the filling out of form fields inside a pdf. It then takes various assets and combines them together to generate a "print ready" product. All of this is accomplished using the magic of iTextSharp. When form fields are populated, they are then flattened to text. The problem is that even with the fonts embedded they aren't really attached to the form fields in a meaningful way (like straight text elements are) and the printers are complaining that the pdf is generating licensing errors due to this. I researched this a bit and it just seems to be the nature of how form fields are.
The artists we are working with requested that we research a way to "outline" the text that is created from flattening the form fields. I found that running the PDF Optimizer with a custom preset allows for Text Outlining in Acrobat, and even better I can generate an Acrobat Sequence that runs this command on the pdf. The problem is that Sequences can not be automated, at all.
I found a plug-in called AutoBatch that allows for the execution of Sequences on the command line through a batch file. The downside is that this would require installing Acrobat Pro and the Plug-in on the server this application will be running on. Further it seems like an overkill solution just to outline the text in the pdf. For all I know at this point iTextSharp may allow me to do this programmatic, but searching for such a thing on google returns little results and nothing relevant.
So the question: Is there a better way to outline text in a pdf than the current solution I have implemented or am I kind of stuck?
TLDR; PDF is generated w/ non-standard fonts. I need to "outline" this text to send it to the printer. Currently using AutoBatch Acrobat Plug-In to execute Acrobat Sequence from the Command Line. Seems excessive, wondering if anyone knows a better way to automate font outlining.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也在打印环境中,并多次使用“盒盖”表单来缩短用于生成盒盖的代码。
我简单地说“
pdfStamper.FormFlattening = true
;”并且打印机(Xerox DP180和DC5000)使用PDF没有问题。当我忽略 FormFlattening 时,打印机会出现很多有关 PDF 的错误。
如果您使用 FormFlattening,请检查打印机本地是否安装了字体,以便它引用打印引擎中的字体而不是 PDF 资源。
I am also in a printing environment and have used forms for "Box Covers" plenty of times to shorten the code used to produce box covers.
I simple us "
pdfStamper.FormFlattening = true
;" and the printers (Xerox DP180 and DC5000) has no problems in using the PDF.The moment I leave out FormFlattening the printer gives a lot of errors regarding the PDF.
If you are using FormFlattening then check if the printer has the font locally installed in order for it to reference the font from the print engine instead of the PDF resources.