centos7上rpm安装wkhtmltopdf

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)

image

安装依赖包

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

image

安装rpm包

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

image

测试

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

image

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

原文地址:https://www.cnblogs.com/xzlive/p/14917289.html