任何人都可以为 Python 推荐一个像样的 FOSS PDF 生成器吗? [英] Can anyone recommend a decent FOSS PDF generator for Python?

查看:37
本文介绍了任何人都可以为 Python 推荐一个像样的 FOSS PDF 生成器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个基本的 pdf 生成器,它可以让我将一些图像和文本转换为 pdf 文件.拥有一些基本绘图命令(线条等)的能力也将是一个加分项.

I need a basic pdf generator that'll let me toss some images and text into a pdf file. The ability to have some basic drawing commands (lines and so forth) would also be a plus.

我确实通读了这个问题,但我真的不需要报告生成器,而且那里的大多数回复似乎对我正在尝试做的事情来说真的是矫枉过正.(我不需要模板或 LaTeX 级布局控件.)

I did read through this question, but I really don't need a report generator and most of the responses there seemed like real overkill for what I'm trying to do. (I don't need templates or LaTeX-grade layout control.)

推荐答案

对于我的一个项目,在过去的六个月中,我已经测试和/或实施了大约六到七种不同的将图像转换为 PDF 的方法.最终我最终回到 ReportLab(我最初出于与您类似的原因而避免使用)描述),因为所有其他人都有明显的限制或完全遗漏(例如无法设置文档元数据).

For one of my projects, I have tested and/or implemented probably six or seven different methods of going from an image to a PDF in the last six months. Ultimately I ended up coming back to ReportLab (which I had initially avoided for reasons similar to those you described) because all of the others had glaring limitations or outright omissions (such as the inability to set document metadata).

ReportLab 并没有乍一看那么难处理,它可能会为您节省大量令人头疼的重构工作.我强烈建议你继续使用它,因此知道如果你想要做更多的事情,你也将拥有这种能力,而不是像我所做的那样在许多不同的实用程序、库、和格式.

ReportLab isn't as difficult to handle as it appears at first glance and it may save you a lot of headache-laden refactoring later on. I would strongly suggest you go ahead and use it and therefore know that if you ever want to be able to do more you will have the ability too rather than do what I did and bounce back and forth between a number of different utilities, libraries, and formats.

还值得一提的是,如果您只想在页面上放置一些文本和图像,您可以绕过 ReportLab 附带的 Platypus 布局系统.

It is also worth mentioning that you can bypass the Platypus layout system that comes with ReportLab if all you want to do is put bit a of text and imagery on a page.

这篇关于任何人都可以为 Python 推荐一个像样的 FOSS PDF 生成器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆