目前是否有使用xhtml2pdf python模块的教程或指南文档?

2024-10-01 00:28:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我似乎找不到这个模块的工作教程或如何操作文档。有人在某处存在吗?在


此处的“待完成”部分: https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst

是有缺陷的,似乎不包含工作代码。更正后,此代码序列:

from xhtml2pdf import pisa as pisa
filename = u'test.pdf'
pdf = pisa.CreatePDF("Hello <strong>World</strong>",file(filename, "wb"))
pisa.startViewer(filename)

产生一个空的测试.pdf文件(不完全是空的,它是一个没有内容的pdf文件)


Tags: 模块文件代码文档httpsgithubcompdf