我在Django应用程序中使用xhtml2pdf将HTML转换为pdf。给我的是我的HTML模板。在
Certificate
WINNER'S
CERTIFICATE
Paul
This is to acknowledge that you won the competition.
4 TIME
Congratulations on winning Challenge.
2018-09-20
Date
我正在使用比萨.CreatePDF生成pdf和CSS没有正确加载。我尝试了默认的\u css,得到了这个错误。在
^{pr2}$
这是我的python代码片段pisa.CreatePDF(io.BytesIO(html.encode('utf-8')),
dest=result, link_callback=fetch_resources,
default_css="/static/css/main.css")