如何生成 PDF 索引页?
我有一个 python 脚本,可以导出 772 个 pdf 并将它们组合成一个多页 pdf 活页夹。导出每个 PDF 时,它还会将当前 pdf 的名称添加为文本文件中的条目。创建整个活页夹后,文本文件中的每个 PDF 页面都会有一个条目,其顺序与 PDF 活页夹相同。我需要使用此文本文件在 PDF 的开头创建索引页,最好链接到文档中的每个页面。
如果我必须手动执行此任务,我会(并且我愿意接受建议),但我希望找到一种方法来自动执行此任务。
另外,这不必在 Python 中完成,但最好将其与我当前的脚本配合起来。
感谢您的反馈,
坦纳
I have a python script that exports 772 pdfs and combines them into a multi-page pdf binder. While exporting each PDF, it also adds the name of the current pdf as an entry in a text file. After the whole binder is created, the text file has an entry for each PDF page in the same order as the PDF binder. I need to use this text file to create an index page at the beginning of the PDF, preferably linking to each page in the document.
If I have to do this task manually, I will (and I'm open to suggestions), but I hope to find a way to automate this.
Also, this doesn't have to be done in Python, but it would be nice to fit it in with my current script.
Thanks for the feedback,
Tanner
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
浏览 arcpy.mapping 的文档,我发现您并不是在开玩笑“它是有限的”。
您是否考虑过向 PDF 添加书签,而不是添加新页面?
我能找到的唯一可以添加书签的 Python 软件是 pdfrecylce。它的版本是 0.05,所以我会冒险猜测它可能不太稳定。
如果您愿意使用 Java 或 C#,可以使用 iText 和 iTextSharp(但我有偏见)。还有很多其他 PDF 库能够处理现有的 PDF...选择一种语言并开始谷歌搜索。
Poking around in the docs for arcpy.mapping, I can see that you weren't kidding about "it's limited".
Rather than adding new pages, have you considered adding bookmarks to the PDF?
And the only Python software I could dig up that can add bookmarks was pdfrecylce. It's in version 0.05, so I'm gonna go out on a limb and guess it might not be too stable.
If you're willing to use Java or C# there's iText and iTextSharp (but I'm biased). There are quite a few other PDF libraries floating around capable of manipulating existing PDFs... pick a language and start googling.
PDFsam 将合并 PDF 并根据每个单独的 PDF 文件名或标题创建带有链接的索引。
我最初下载了 PDFsam Basic,因为它会自动按照文件夹结构的顺序组织要合并的 PDF,而不仅仅是按字母顺序。要从各个文件夹添加多个 PDF,我会转到目录,搜索“.”以找到并选择要添加的所有 PDF。我认为 PDFsam 增强版允许您简单地拖放整个文件夹目录。强烈推荐。
PDFsam will merge PDFs and create an index with links based on each individual PDF file name or title.
I initially downloaded PDFsam Basic because it will auto organize the PDFs to be merged in order of folder structure instead of only alphabetically. To add multiple PDFs from various folders I go to a directory, search "." to locate and select all the PDFs to add. I think the PDFsam Enhanced allows you to simply drag and drop an entire folder directory. Highly recommend.