centos7安装Wkhtmltopdf


官网下载预编译版安装:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvfJ wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
cd wkhtmltox/bin
sudo mv ./wkhtmltopdf /usr/bin/wkhtmltopdf
sudo chmod +x /usr/bin/wkhtmltopdf

测试: wkhtmltopdf http://www.baidu.com ./test.pdf

 

此时如果生成的字符都是方块,那么安装standard PostScript fonts: yum install urw-fonts libXext openssl-devel

如果中文不显示,则将 windows下的字体,例如simsun.ttc ,或者msyh.ttf,或者msyhbd.ttf 复制到 linux系统 /usr/share/fonts 下

 

参考:https://blog.csdn.net/qw_xingzhe/article/details/80607283


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM