wkhtmktopdf
1:
sudo apt-get install wkhtmltopdf
2:
sudo apt-get xvfb
3: 切换到root用户:
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
4:ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
5:安装完成了,测试下:
wkhtmltopdf http://www.baidu.com output.pdf
php用到此工具的api: https://github.com/hongtoushizi/phpwkhtmltopdf