centos7安装wkhtmltopdf

下载rpm包

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
(或者可以去这个地址找合适的版本https://github.com/wkhtmltopdf/wkhtmltopdf/releases)

centos7上rpm安装wkhtmltopdf_centos

安装依赖包

yum install xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 libXrender -y

centos7上rpm安装wkhtmltopdf_html_02

安装rpm包

rpm -ivh wkhtmltox-0.12.5-1.centos7.x86_64.rpm

centos7上rpm安装wkhtmltopdf_中文字体_03

测试

wkhtmltopdf http://www.baidu.com ./baidu.pdf

centos7上rpm安装wkhtmltopdf_rpm包_04

注意:查看生成的pdf是否缺少中文字体