odoo14 pdf报表 wkhtmltopdf 安装

Linux系统版本:openEuler系统

[odoo14@localhost ~]$ cat /etc/os-release 
NAME="openEuler"
VERSION="21.03"
ID="openEuler"
VERSION_ID="21.03"
PRETTY_NAME="openEuler 21.03"
ANSI_COLOR="0;31"

1.下载wkhtmltopdf

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm

我用的centos8系统版本 64位的,你们也可以下载自己适合的版本:wkhtmltopdf官网下载

2.安装wkhtmltopdf

rpm -ivh wkhtmltox-0.12.5-1.centos8.x86_64.rpm 

这里遇到问题报错:

[odoo14@localhost ~]$ rpm -ivh wkhtmltox-0.12.5-1.centos8.x86_64.rpm 
错误:依赖检测失败:
    xorg-x11-fonts-Type1 被 wkhtmltox-1:0.12.5-1.centos8.x86_64 需要

出现依赖错误,先安装相应依赖:

[odoo14@localhost ~]$ sudo yum install xorg-x11-fonts-Type1

如果缺乏其他依赖也是一样先安装上:yum install -y libpng libjpeg openssl icu libX11 libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi

安装好依赖好,继续安装就正常了直接安装成功

[odoo14@localhost ~]$ sudo rpm -ivh wkhtmltox-0.12.5-1.centos8.x86_64.rpm 
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:wkhtmltox-1:0.12.5-1.centos8     ################################# [100%]

3.测试是否安装成功

[odoo14@localhost ~]$ wkhtmltopdf www.baidu.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       

如果没有报错并且生成了pdf文件则说明安装成功了。

其他版本安装方式

1 下载相应版本的wkhtmltopdf
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz (centos7 64)

2 解压文件
tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd wkhtmltox/bin/

3 复制命令
cp ./wkhtmltoimage /usr/local/bin/
cp ./wkhtmltopdf /usr/local/bin/

4 安装相关依赖
yum install libXext*

5 重启odoo服务

ps:我最开始安装的是 wkhtmltox-0.12.4_linux-generic-amd64.tar.xz,这是最稳定的版本。但是测试时报以下错误,尝试进行了修复发现解决不了,就重新安装了新的版本

Loading pages (1/6)
QSslSocket: cannot resolve CRYPTO_num_locks                  ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
段错误 (核心已转储)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值