cenos7安装wkhtmltopdf

  • Post author:
  • Post category:其他


参考:


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



版权声明:本文为book_1992原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。