centos8 请查看:https://www.cnblogs.com/architectforest/p/12706426.html
wget https://obs-gyktest.obs.cn-southwest-2.myhuaweicloud.com/ajar/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
下面是centos7
1、下载
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
华为云OBS上:
https://obs-gyktest.obs.cn-southwest-2.myhuaweicloud.com/ajar/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
2、解压
tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
3、配置
cd wkhtmltox/bin/
sudo mv ./wkhtmltopdf /usr/bin/wkhtmltopdf
sudo chmod +x /usr/bin/wkhtmltopdf
yum install urw-fonts libXext openssl-devel
4、配置中文
cd /usr/share/fonts/
mkdir chinese
cd chinese
mkdir TrueType
cd TrueType
wget https://obs-gyktest.obs.cn-southwest-2.myhuaweicloud.com/ajar/simsun.ttc
chmod -R 777 /usr/share/fonts/chinese
5、测试
wkhtmltopdf http://www.baidu.com ./test.pdf
网友评论