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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章