python - 将XHTML转换为PDF的纯python解决方案

标签 python google-app-engine pdf

我正在寻找一个纯 Python 解决方案(用于 GAE)将网页转换为 pdf。

我看过reportlab但文档侧重于从头开始生成 pdf,而不是从 HTML 转换。

您有什么建议? - pisa

编辑: 我的用例是我有一个 HTML 报告,我也想以 PDF 格式提供。我将更新此报告结构,因此我不想维护单独的 PDF 版本,但(希望)自动转换。
此外,因为我生成了报告 HTML,所以我可以确保它是格式正确的 XHTML,从而使 PDF 转换更容易。

最佳答案

Pisa声称支持我想做的事情:

pisa is a html2pdf converter using the ReportLab Toolkit, the HTML5lib and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python so it is platform independent. The main benefit of this tool that a user with Web skills like HTML and CSS is able to generate PDF templates very quickly without learning new technologies. Easy integration into Python frameworks like CherryPy, KID Templating, TurboGears, Django, Zope, Plone, Google AppEngine (GAE) etc.

所以我会进一步调查

关于python - 将XHTML转换为PDF的纯python解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1598715/

相关文章:

security - 他们的应用程序之间的谷歌身份验证和授权

html - 从网页链接到 PDF 文档中的特定部分( anchor )

flutter - 检测 pdfviewer 内的触摸。当小部件处理自己的触摸事件时强制检测触摸

python - 将字符串中的所有字符转换为python中的ascii hex

python - Pandas 比较两个数据帧并确定匹配的值

python - 如何在Python中同时启动线程

python - 如何使用 python 列表理解/字典将每一列打印为唯一变量

python - Google Apps Engine 数据存储区搜索

security - 谷歌应用引擎 : security of cron jobs

html - CSS - 一种适合 dinA4 打印的形式