Using username “terry”.
Last login: Sun Feb 16 21:46:27 2020 from 192.168.31.134
[terry@MiWiFi-R4AC-srv ~]$ su
密码:
[root@local terry]#
[root@local terry]# pwd
/home/terry
[root@local terry]# cd /usr/local/src/
[root@local src]# ls
wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
[root@local src]#
[root@local src]#
[root@local src]#
[root@local src]#
[root@local src]# tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
wkhtmltox/
wkhtmltox/lib/
wkhtmltox/lib/libwkhtmltox.so.0.12.4
wkhtmltox/lib/libwkhtmltox.so.0
wkhtmltox/lib/libwkhtmltox.so.0.12
wkhtmltox/lib/libwkhtmltox.so
wkhtmltox/include/
wkhtmltox/include/wkhtmltox/
wkhtmltox/include/wkhtmltox/image.h
wkhtmltox/include/wkhtmltox/dllbegin.inc
wkhtmltox/include/wkhtmltox/pdf.h
wkhtmltox/include/wkhtmltox/dllend.inc
wkhtmltox/bin/
wkhtmltox/bin/wkhtmltoimage
wkhtmltox/bin/wkhtmltopdf
wkhtmltox/share/
wkhtmltox/share/man/
wkhtmltox/share/man/man1/
wkhtmltox/share/man/man1/wkhtmltopdf.1.gz
wkhtmltox/share/man/man1/wkhtmltoimage.1.gz
[root@local src]# ls
wkhtmltox wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
[root@local src]# cd wkhtmltox/bin
[root@local bin]# ls
wkhtmltoimage wkhtmltopdf
[root@local bin]# sudo mv ./wkhtmltopdf /usr/bin/wkhtmltopdf
[root@local bin]# sudo chmod +x /usr/bin/wkhtmltopdf
[root@local bin]#
[root@local bin]#
[root@local bin]# wkhtmltpdf
bash: wkhtmltpdf: 未找到命令
[root@local bin]# cd /usr/bin/
[root@local bin]# wkhtmltopdf
wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open
[root@local bin]#
[root@local bin]# error while loading shared libraries: libXrender.so.
[root@local bin]#
[root@local bin]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
依赖关系解决
正在安装:
libXrender x86_64
libXrender-devel x86_64
为依赖而安装:
libX11 x86_64
libX11-common noarch
libX11-devel x86_64
libXau x86_64
libXau-devel x86_64
libxcb x86_64
libxcb-devel x86_64
xorg-x11-proto-devel noarch
安装 2 软件包 (+8 依赖软件包)
总计
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : xorg-x11-proto-devel-2018.4-1.el7.noarch
正在安装 : libXau-1.0.8-2.1.el7.x86_64
正在安装 : libxcb-1.13-1.el7.x86_64
正在安装 : libXau-devel-1.0.8-2.1.el7.x86_64
正在安装 : libxcb-devel-1.13-1.el7.x86_64
正在安装 : libX11-common-1.6.7-2.el7.noarch
正在安装 : libX11-1.6.7-2.el7.x86_64
正在安装 : libXrender-0.9.10-1.el7.x86_64
正在安装 : libX11-devel-1.6.7-2.el7.x86_64
正在安装 : libXrender-devel-0.9.10-1.el7.x86_64
验证中 : libXrender-devel-0.9.10-1.el7.x86_64
验证中 : libxcb-devel-1.13-1.el7.x86_64
验证中 : libXau-1.0.8-2.1.el7.x86_64
验证中 : libXrender-0.9.10-1.el7.x86_64
验证中 : libX11-devel-1.6.7-2.el7.x86_64
验证中 : xorg-x11-proto-devel-2018.4-1.el7.noarch
验证中 : libX11-1.6.7-2.el7.x86_64
验证中 : libX11-common-1.6.7-2.el7.noarch
验证中 : libxcb-1.13-1.el7.x86_64
验证中 : libXau-devel-1.0.8-2.1.el7.x86_64
已安装:
libXrender.x86_64 0:0.9.10-1.el7
作为依赖被安装:
libX11.x86_64 0:1.6.7-2.el7 libX11-common.noarch 0:1.6.7-2.el7
xorg-x11-proto-devel.noarch 0:2018.4-1.el7
完毕!
[root@local lib]# cd /bin
[root@local bin]# wkhtmltopdf www.baidu.com /baidu.pdf
wkhtmltopdf: error while loading shared libraries: libfontconfig.so.1: cannot op
[root@local bin]# yum install libfontconfig*
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
依赖关系解决
正在安装:
fontconfig x86_64
为依赖而安装:
dejavu-fonts-common noarch
dejavu-sans-fonts noarch
fontpackages-filesystem noarch
安装 1 软件包 (+3 依赖软件包)
总计
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : fontpackages-filesystem-1.44-8.el7.noarch
正在安装 : dejavu-fonts-common-2.33-6.el7.noarch
正在安装 : dejavu-sans-fonts-2.33-6.el7.noarch
正在安装 : fontconfig-2.13.0-4.3.el7.x86_64
验证中 : fontpackages-filesystem-1.44-8.el7.noarch
验证中 : dejavu-fonts-common-2.33-6.el7.noarch
验证中 : fontconfig-2.13.0-4.3.el7.x86_64
验证中 : dejavu-sans-fonts-2.33-6.el7.noarch
已安装:
fontconfig.x86_64 0:2.13.0-4.3.el7
作为依赖被安装:
dejavu-fonts-common.noarch 0:2.33-6.el7
完毕!
[root@local bin]# wkhtmltopdf www.bing.com /baidu.pdf
wkhtmltopdf: error while loading shared libraries: libXext.so.6: cannot open sha
[root@local bin]# yum install libXext*
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
依赖关系解决
正在安装:
libXext x86_64
libXext-devel x86_64
安装 2 软件包
总计
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : libXext-1.3.3-3.el7.x86_64
正在安装 : libXext-devel-1.3.3-3.el7.x86_64
验证中 : libXext-1.3.3-3.el7.x86_64
验证中 : libXext-devel-1.3.3-3.el7.x86_64
已安装:
libXext.x86_64 0:1.3.3-3.el7
完毕!
[root@local bin]# wkhtmltopdf www.bing.com /baidu.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[root@local bin]#
[root@local bin]#