我正在寻找某种方法来编写一个函数(目前我对任何语言或库持开放态度),以将现有的 PDF 文件作为输入,并返回一个修改后的 PDF 文件,该文件将某些单词链接到不同的 URL。我知道 PHP 和 ColdFusion 都有处理 PDF 的好工具,但我还没有找到任何有效的工具。
我一直通过使用 Acrobat 并手动链接文本来完成此操作,并且想知道是否有任何方法可以自动化该过程。
谢谢!
I am looking for some way to code a function (I'm open to any language or library at this point) to take an already existing PDF file as input and return a modified PDF file that links certain words to different URLs. I know PHP and ColdFusion both have good tools for dealing with PDF's, but I haven't been able to find anything that works.
I've been doing this by going through Acrobat and linking the text by hand and was wondering if there was any way to automate the procedure.
Thanks!
发布评论
评论(2)
使用 ColdFusion,您可以使用 DDX 提取文本(请参阅< em>从页面上的 PDF 文档中提取文本),使用搜索/替换对其进行修改并生成新文档。
With ColdFusion you can extract the text with DDX (see Extracting text from a PDF document on the page), modify it using search/replace and generate new document.
如果我明白你想要做什么,你应该能够使用 CFPDF (http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_02.html#2922772)将pdf文件读入ColdFusion变量,替换您想要的任何内容变量,然后将内容保存回 pdf。
If I understand what you're trying to do, you should be able to use CFPDF (http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_02.html#2922772) to read the pdf file into a ColdFusion variable, replace whatever content you want in that variable, then save the content back to pdf.