[Linux服务器] Linux上安装wkhtmltopdf

1141 0
Honkers 2025-3-11 16:43:06 | 显示全部楼层 |阅读模式

Linux上安装wkhtmltopdf

  1. 执行:getconf LONG_BIT 查看系统是多少位
复制代码


wkhtmltopdf 下载地址 http://wkhtmltopdf.org/downloads.html

我的操作系统是 CentOS 7 所以选择图中版本


然后把rpm文件传输到linux,在rpm文件目录使用rpm安装:rpm -ivh wkhtmltopdf的rpm文件名称

安装依赖:yum install -y fontconfig libX11 libXext libXrender libjpeg libpng xorg-x11-fonts-75dpi xorg-x11-fonts-Type1

再次执行rpm安装:rpm -ivh wkhtmltopdf的rpm文件名称

安装后测试:wkhtmltopdf https://www.baidu.com/ /home/test.pdf

如果中文是乱码,把Windows字体:C:\Windows\Fonts,拷贝到linux目录:/usr/share/fonts/

再次测试:wkhtmltopdf https://www.baidu.com/ /home/test.pdf就正常了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行