我正在将python中的HTML文件转换为pdf,并将这些pdf文件附加到邮件和处理中。
我的应用程序部署时没有任何问题,当我在Heroku中运行代码时,我会得到错误。
Exception :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这是当我没有将wkhtmltopdf路径添加到系统时所收到的相同错误,正如我们在构建Moving wkhtmltopdf binaries to /app/bin中所看到的,如何使Heroku配置到这个wkhtmltopdf二进制路径?我们如何使用Heroku中的config vars来完成这项工作?
我试过这个生成-pdfs-wkhtmltopdf-heroku,但没能得到它。无论我在哪里搜索ruby的解决方案,我们都需要配置am文件,我如何在python中这样做呢?
从过去的两天开始,我一直在做这个工作,请帮帮我
提前感谢
梅加纳古德
发布于 2019-08-13 20:58:29
我现在使用OSX和heroku来部署我的烧瓶应用程序。部署时,heroku wkhtmltopdf二进制文件位于./bin/wkhtmltopdf中。所以我写了这个代码来处理这个问题。
if (platform.system() == 'Darwin'):
config = pdfkit.configuration()
else:
config = pdfkit.configuration(wkhtmltopdf='./bin/wkhtmltopdf')https://stackoverflow.com/questions/51720924
复制相似问题