Wkhtmltopdf的安裝與使用

來源:互聯網
上載者:User

1.下載
到https://wkhtmltopdf.org/downloads.html下載stable(穩定版)Linux  64-bit或者32-bit(根據自身系統選擇)

2.解壓
64:tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
32:tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz

3.拷貝程式
cp wkhtmltox/bin/wkhtmltopdf /usr/bin/
將程式拷貝到/usr/bin/目錄中,這樣可以任意目錄執行。

4.使用
wkhtmltopdf [選項] 檔案源地址 檔案目標地址
wkhtmltopdf http://www.wpbeginner.com/plugins/7-best-wordpress-backup-plugins-compared-pros-and-cons/ 7-best-wordpress-backup.pdf

5.中文問題
如果wkhtmltopdf中文顯示空白或者亂碼方框,開啟windows c:\Windows\fonts\simsun.ttc(在網上下載simsun.ttc也可以)拷貝到linux伺服器/usr/share/fonts/目錄下,再次產生pdf中文顯示正常

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.