python生成pdf報告、python實現html轉換爲pdf報告[python3]

centos 6.10html

import pdfkit
pdfkit.from_url('http://google.com','out.pdf')    

pdfkit.from_file('test.html','out.pdf')   

pdfkit.from_string('Hello!','out.pdf')

系統安裝wkhtmltopdf:參考 https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdfpython

安裝wkhtmltox 須要安裝如下兩個系統包git

xorg-x11-fonts-75dpi is needed by wkhtmltox-1:0.12.5-1.centos6.x86_64
    xorg-x11-fonts-Type1 is needed by wkhtmltox-1:0.12.5-1.centos6.x86_64github

效果不太好
 centos

相關文章
相關標籤/搜索