wkhtmltox 在Linux上安装

参考:https://gist.github.com/apphancer/8654e82aa582d1cf02c955536df06449

# Install dependencies (if needed)
$ yum install -y xorg-x11-fonts-75dpi
$ yum install -y xorg-x11-fonts-Type1
$ yum install xz

# Get latest version of wkhtmltopdf (replace version number if needed)
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

# Untar and move wkhtmltox
$ unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar
$ mv wkhtmltox /usr/bin/wkhtmltox

# Add wkhtmltopdf to .bash_profile (optional)
nano .bash_profile
# Add the following line at the end of the .bash_profile file
# export PATH=/usr/bin/wkhtmltox/bin:$PATH

# And don't forget..
$ rm wkhtmltox-0.12.4_linux-generic-amd64.tar

# Finally enjoy!
$ wkhtmltopdf http://www.google.com google.pdf

 

posted @ 2021-04-22 18:02  feiquan  阅读(916)  评论(0编辑  收藏  举报
如果是此文是转载文章,本人会附上转载链接,此篇文章的版权归原创作者所属,如果侵权请与我联系,我会删除此文。

若没有标明转载链接,此篇文章属于本人的原创文章,其版权所属:
作者:feiquan
出处:http://www.cnblogs.com/feiquan/
版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
大家写文都不容易,请尊重劳动成果~ 这里谢谢大家啦(*/ω\*)