python使用pdfkit生成pdf【python】
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.安装pdfkit pip3 install pdfkit 代码: html = '<html><head><meta charset="UTF-8"></head>' \ '<body><div align="center"><p>%s</p></div></body></html>' % text pdfkit.from_string(html, './result.pdf') 或者 pdfkit.from_file(1.html, './result.pdf') 2.测试运行 运行python3 test.py后报错 If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf 缺少:wkhtmltopdf 进行安装 yum install wkhtmltopdf github地址: https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf