码迷,mamicode.com
首页 > 编程语言 > 详细

python转html页面为pdf

时间:2018-10-19 20:50:16      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:.com   googl   python   get   string   ref   hello   import   port   

python转html页面为pdf:

安装wkhtmltopdf略

apt-get install python-pip

pip install pdfkit

vi aa.py

#!/usr/bin/python

import pdfkit

pdfkit.from_url(‘http://google.com‘,‘baidu.pdf‘)

:wq

python aa.py

pdfkit.from_string(‘hello,python‘,‘baidu.pdf‘)

pdfkit.from_file(‘aa.html‘,‘baidu.pdf‘)

python转html页面为pdf

标签:.com   googl   python   get   string   ref   hello   import   port   

原文地址:http://blog.51cto.com/yangzhiming/2306665

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!