【发布时间】:2018-10-05 03:26:16
【问题描述】:
我的 django 应用程序中有一个模板,我需要将它呈现在一个变量中或将它保存在一个 html 文件中。
我的目标是将模板的 html 渲染转换为 pdf,我正在使用 pdfkit,因为它是我见过的最好的 html 到 pdf 转换器,reportlab 没有做我想要的。
当我尝试做这样的事情时:
pdf = pdfkit.from_file ('app / templates / app / table.html', 'table.pdf')
我得到了 pdf,但打印的是这样的:
感谢您的帮助!
【问题讨论】: