什么程序可以在 Linux 上从 Python 编写 pdf(包括其他 pdf)?
在 Ubuntu 服务器上,我想创建包含其他静态 pdf 的 pdf。我尝试过将 ReportLab 与 pyPdf 一起使用。理想情况下,我会使用 ReportLab 来完成整个操作,但为了导入 pdf,需要使用 PageCatcher,该程序需要支付大量经常性费用。
因此,我使用 pyPdf 合并使用 ReportLab 创建的页面和我的其他 pdf 文件。问题是,尽管在 Acrobat 和 Foxit 中看起来不错,但其中一页的部分内容在 Xerox 7400 彩色打印机上打印时会出现乱码。我无法弄清楚这个问题,但如果存在并且价格合理,我愿意购买更集成的解决方案。我以为 PDF Creator Pilot 就是它,直到我发现它仅适用于 Windows。
那么是否有价格合理(1000 美元或更少)的解决方案或不同的建议?
On an Ubuntu server, I want to create pdfs which include other static pdfs. I have tried using ReportLab with pyPdf. Ideally I would use ReportLab to do the whole thing, but in order to import the pdfs requires their PageCatcher which has a large recurring fee.
So I use pyPdf to merge a page created with ReportLab and my other pdfs. The problem is that even though this looks fine in Acrobat and Foxit, part of one of the pages prints garbled on a Xerox 7400 color printer. I can't figure out the issue, but would be willing to buy a more integrated solution if it existed and was reasonably priced. I thought PDF Creator Pilot was it until I saw that it was Windows only.
So is there a reasonably priced ($1K or less) solution or a different suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 Java 库 iText 取得了很大的成功。他们有一个很棒的示例库,几乎可以满足您对 PDF 文件所能想到的任何操作。此示例用于连接 PDF 文件,听起来它可以满足您的需求: http://itextpdf.com/examples/index.php?page=example&id=123。还有 PDFBox,它是另一个很棒的基于 Java 的 PDF 操作库。
我知道您正在寻找基于 Python 的解决方案,但可能没有很多其他选择。如果您使用 Jython 解释器而不是 CPython,那么集成到 iText 中应该很简单。如果没有,那么您可以考虑将其作为一个单独的进程调用。我意识到这可能不适合您的情况,但我想我会提到它作为一种选择。
I have had a lot of success with the Java library iText. They have a great library of samples for pretty much anything you could think of doing with PDF files. This example is for concatenating PDF files and sounds like it would do what you need: http://itextpdf.com/examples/index.php?page=example&id=123. There is also PDFBox which is another great Java based PDF manipulation library.
I realize that you are looking for a Python based solution but there may not be many other options. If you are using the Jython interpreter instead of CPython, integrating in iText should be trivial. If not, then you could consider calling out to it as a separate process. I realize that may not be idea for your situation but I figured I would mention it as an option.
另一个非 Python 答案。如果您只是合并页面,那么 pdftk 可以很好地做到这一点(以及许多其他功能) 。
Another non-Python answer. If you are just merging pages, then pdftk does that well (along with a lot of other things).