Python generates pdf reports and python converts html to pdf reports
This article mainly explains "python generates pdf reports and python realizes html conversion to pdf reports". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "python generates pdf reports and python realizes html conversion to pdf reports" together!
centos 6.10
import pdfkitpdfkit.from_url('http://google.com','out.pdf') pdfkit.from_file('test.html','out.pdf') pdfkit.from_string('Hello! ','out.pdf')
System installation wkhtmltopdf: Refer to https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
To install wkhtmltox, you need to install the following two system packages
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_64
effect is not very good
Thank you for reading, the above is the content of "python generates pdf report and python realizes html conversion to pdf report". After studying this article, I believe that everyone has a deeper understanding of python generates pdf report and python realizes html conversion to pdf report. The specific use situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!