LoginSignup
1
1

More than 3 years have passed since last update.

♨️【CentOS】wkhtmltopdfのインストール方法

Last updated at Posted at 2020-01-23

環境

CentOS 7.4.1708

やりたいこと

wkhtmltopdfはHTMLを取り込んでそのままPDFファイルを生成してくれる便利なライブラリ

やったこと

次の4つのコマンドを順に実行

centos.sh
1.
cd /usr/local/bin
2.
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
3.
xz -dv wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
4.
tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar

エラー発生時

2.の実行時に下記のエラーで進行しない場合は--no-check-certificateを付けて再実行

centos.sh
[root@localhost bin]# wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
--2020-01-23 00:02:50--  https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
Resolving downloads.wkhtmltopdf.org (downloads.wkhtmltopdf.org)... 107.174.217.167, 107.174.217.167
Connecting to downloads.wkhtmltopdf.org (downloads.wkhtmltopdf.org)|107.174.217.167|:443... connected.
ERROR: cannot verify downloads.wkhtmltopdf.org's certificate, issued by ‘/CN=GlobalProtect.com’:
  Self-signed certificate encountered.
To connect to downloads.wkhtmltopdf.org insecurely, use `--no-check-certificate'.
centos.sh
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz --no-check-certificate

バージョン確認

下記が通ればインストール成功

centos.sh
[root@localhost bin]# /usr/local/bin/wkhtmltox/bin/wkhtmltopdf -V
wkhtmltopdf 0.12.4 (with patched qt)
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1