cenos7安装wkhtmltopdf

参考:

cenos7安装wkhtmltopdf_centos7 安装wkhtmltopdf_春风霓裳的博客-CSDN博客
Using wkhtmltopdf without X server · JazzCore/python-pdfkit Wiki · GitHub

具体:

1. yum install wkhtmltopdf

2.yum install xorg-x11-server-Xvfb

3. 替换指令

printf '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf

4. 测试:wkhtmltopdf.sh www.baidu.com 2.pdf

你可能感兴趣的:(pdf)