pdfkit部署(导出pdf的python插件)

1、pdfkit安装

pip3 install pdfkit

2、python使用pdfkit中,调用pdfkit.from_string等,就会出现以下错误。而且如果你使用pip  install wkhtmltopdf,安装完还是会出现这个问题

OSError at /xxx/xxx/xxx/xxx/export/
No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf

3、直接下载wkhtmltopdf可执行文件

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

根据操作系统的类型下载
这里下载的是centos7
wkhtmltox-0.12.6-1.centos7.x86_64

4、wkhtmltopdf安装

例如centos7系统
rpm -ivh wkhtmltox-0.12.6-1.centos7.x86_64

可能会缺少依赖包
yum install xorg-x11-fonts-75dpi
yum install xorg-x11-fonts-Type1

windows系统安装完
把安装目录(C:\Program Files\wkhtmltopdf)添加到环境变量path中

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值