【发布时间】:2015-06-09 04:02:40
【问题描述】:
我正在尝试将烧瓶中呈现的 html 页面保存为 pdf。 我尝试了以下方法:
pdf=render_template('exp1_post.html',some_data=some_data)
filename = "simplePrint.pdf"
pisa.CreatePDF(pdf, file(filename, "w"))
和
pdf=render_template('exp1_post.html',some_data=some_data)
filename = "simplePrint.pdf"
pisa.CreatePDF(pdf.encode("ISO-8859-1"), file(filename, "w"))
但生成的 pdf 文件在 Google Chrome 中完全可见(通过转到磁盘上的位置直接打开),但我在 Adobe acrobat 阅读器中得到空白页。
我能找到的类似问题:PDF text show in Google Chrome but not in Adobe Acrobat
但我不确定如何在 python 中实现上述解决方案 Chrome 版本 41.0.2272.118 m Adobe Reader XI
【问题讨论】:
-
您能否发布一个显示此问题的示例 PDF 文档?这可能有助于某人了解问题的实质,并可能有助于您解决问题。
-
当然。这是一个这样的 pdf,大小为 2.73 kb。 Google Drive 链接(我应该以其他方式分享它吗?比如不知道的 pastebin 服务?)。您将看到表格等以获取用于滴定数据提交的空白表格。 file
标签: python google-chrome pdf flask