简体   繁体   English

xhtml2pdf 在创建 PDF 时不显示 GBP(“£”)符号

[英]xhtml2pdf is not displaying GBP ("£") signs while creating PDF

While creating PDF using xhtm2pdf we are unable to print "£" sign but works for dollar and euro.使用 xhtm2pdf 创建 PDF 时,我们无法打印“£”符号,但适用于美元和欧元。 We have used setting font face and changed font family but still we are not able to print GBP.我们已经使用了设置字体并更改了字体系列,但仍然无法打印 GBP。

When you call pisa.CreatePDF() make sure to include encoding.当您调用pisa.CreatePDF()时,请确保包含编码。

Here's what we use, obviously its a bit out of context but it was mostly copied from the example documentation.这是我们使用的内容,显然它有点脱离上下文,但它主要是从示例文档中复制的。

pisaStatus = pisa.CreatePDF(html.encode('UTF-8'), encoding="UTF-8", dest=f, link_callback=link_callback)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM