_____ __ __ _____ _ __ _ _
|_ _| | \/ | / ____| | |/ / (_) | |
| | | \ / | | | __ | ' / _ | |_
| | | |\/| | | | |_ | | < | | | __|
_| |_ | | | | | |__| | | . \ | | | |_
|_____| |_| |_| \_____| |_|\_\ |_| \__|
用于wkhtmltoimage实用程序将html转换为img的python 2和3包装器
使用WebKit。
安装安装imgkit:pipinstallimgkit
安装wkhtmltoppdf:debian/ubuntu:sudo apt-get install wkhtmltopdf
警告!Debian/UbuntuRepos中的版本已经减少
功能(因为它编译时没有wkhtmltopfqt
修补程序),如添加大纲、页眉、页脚、目录等
此选项应安装静态二进制文件
wkhtmltopdf站点或您可以使用此
script。
MacOSXbrew install wkhtmltopdf
用法
简单示例:importimgkitimgkit.from_url('http://google.com','out.jpg')imgkit.from_file('test.html','out.jpg')imgkit.from_string('Hello!'