Django pdf 问题
我想知道是否有一种方法可以将整个 html 文档生成为 pdf 文件。我已经报告了实验室,并且过去已经用字符串做过一些示例。但我想知道是否有办法将模板更改为某些输出(即 pdf 文件)。
I Want to know if there is a way I could generate a whole html document into a pdf file. I have already report lab and have done some examples with strings before in the past. But I want to know if there is a way how to change a template into some output which is a pdf file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看Pisa/XHTML2PDF。几年前我用它做了一些实验,但当它被证明不够时,我转而使用纯 ReportLab。它可能比我的更适合您的需求。
Take a look at Pisa/XHTML2PDF. I did some experiments with it a couple of years back but switched to pure ReportLab when it proved inadequate. It may fit your needs better than it did mine.
实际上,该转换器存在于 ReportLab 的付费版本中,该版本的软件包名称为 rlextra。该转换器称为 html2rml,因此它会给您一个 RML 字符串,然后您需要使用 rml2pdf 才能使用它。它可能适用于免费的 RML 实现,但您最好将问题发布到 reportlab 邮件列表。
there is actually, the converter however lives in the paid version of ReportLab which is packages under the name rlextra. The converter is called html2rml so it would give you an RML string back which then you need to use rml2pdf to use it. It might work with the free RML implementation but you better post your question to the reportlab mailing list.