如何使用自动流程生成 PDF
我编写了一个 Web 应用程序,用于通过将数据填充到预先保存的 PDF 模板(由 acrobat 编辑的模板)和一些文本字段来生成 PDF。但这些文本字段的上下文似乎位于不同的层,并且不会影响模板中的其他现有单词。
...但我希望它影响现有的单词,并使它们根据填充到文本字段的数据量而流动。
解决方案可能是使用程序生成整个 PDF,而不是使用模板。但在我的情况下,模板经常变化,我不想浪费很多时间通过编码来调整位置和格式...
有人知道如何在 PDF 模板中使用具有自动流动的文本字段吗?就像Word文档一样。
I wrote a web app for generating PDF by filling data into a pre-saved PDF template, template edited by acrobat, with some text-fields. But the context of those text-fields seems in a different layer and cannot affect other existing words in template.
... But I want it affect the existing words and make them flow base on how many data fill into the text-fields.
The solution maybe use program to generate a whole PDF instead of using template. But the template changes really often in my case, I don't want waste a lot of time to adjust the position and format by coding...
Do anyone know how to use text-field with auto flow in a PDF template? just like a Word document.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PDF 不是这样工作的。您需要生成整个 PDF。
啊……但是从哪里来呢?
有相当多的 HTML->PDF 转换器。您可以填写 HTML 模板,然后以这种方式进行转换。
您可以开发自己的输入格式(针对您的模板),并编写一个应用程序来读取它并构建 PDF。
后者与 HTML->PDF 非常相似,除非您找不到可以处理某些 PDF 功能或您需要的其他功能的转换器,否则我就会走这条路。有很多 html->pdf 应用程序。你可以搜索SO,谷歌,等等。很多。
PDF doesn't work like that. You need to generate the whole PDF.
Ah... but from what?
There are quite a few HTML->PDF converters out there. You could fill in your template HTML, and convert it that way.
You could develop your own input format (for your template), and write an app that reads it and builds a PDF.
The later is similar enough to HTML->PDF, that unless you can't find a converter that handles some PDF feature or other you need, I'd just go that route. There are LOTS of html->pdf apps out there. You can search SO, google, whatever. Lots.