linux 安装 wkhtmltox
linux安装wkhtmltox
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.4_linux-generic-amd64.tar.xz
sudo mv ./wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
sudo chmod +x /usr/bin/wkhtmltopdf
sudo cp /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
解决中文不显示的问题
网络上下载宋体(simsun.ttc,simsun.ttf)文件
上传到服务器的 /usr/share/fonts/chinese/TrueType/ 文件夹中(没有这些文件夹新建即可)
cd /usr/share/fonts/chinese/TrueType/
cd /usr/share/fonts
mkdir chinese
cd chinese
mkdir TrueType
cd TrueType
测试
wkhtmltopdf ww.baidu.com ./test.pdf