如何在heroku应用程序中使用npm pdf图像包 [英] how to use npm pdf image package in heroku app

查看:48
本文介绍了如何在heroku应用程序中使用npm pdf图像包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 npm 包 pdf-image (https://www.npmjs.com/package/pdf-image) 用于部署在 heroku 上的应用程序.它需要 imagemagick ghostscript poppler-(确保您有 convert、gs 和 pdfinfo(poppler 的一部分)命令).

I'm attempting to use the npm package pdf-image (https://www.npmjs.com/package/pdf-image) for an app that is deployed on heroku. It requires imagemagick ghostscript poppler- (ensure you have convert, gs, and pdfinfo (part of poppler) commands).

我尝试将 imagemagick、ghostscript 和 poppler buildpack 添加到应用程序,然后进行部署.该应用程序正在运行,但在涉及需要 pdf-image 包的方法时超时(h12 heroku 错误).

I've attempted to add a imagemagick, ghostscript, and poppler buildpack to the app and then deploy. The app is working but times out (h12 heroku error) when it comes to the method that requires the pdf-image package.

该方法在本地工作没有问题.

The method works locally without problem.

我不知道如何解决问题.我看到有很多不同的选项可用于 buildpack,我想知道我是否添加了最好的一个.

I'm not sure how to trouble shoot. I see that there are a lot of different options to use for the buildpacks and am wondering if I added the best one or not.

有没有人用 pdf-image 包部署到 heroku?您为 ghostcript、imagemagick 和 poppler 推荐哪些 buildpack?超时的其他可能原因以及故障排除方法是什么?

Has anyone deployed to heroku with the pdf-image package? Which buildpacks do you recommend for ghostcript, imagemagick, and poppler? What are other possible causes for the time out and ways to troubleshoot?

谢谢!

推荐答案

取决于您使用的 heroku 堆栈.

Depends on what heroku stack you're using.

https://github.com/Fieldwire/heroku-buildpack-poppler

这个 buildpack 在 heroku-18 堆栈上对我有用.您可以在此处找到更多构建包.

This buildpack has worked for me on heroku-18 stack. You can find more buildpacks here .

如果您的服务器上尚未安装该库,您也可以检查此处和什么版本.例如,imagemagickghostscriptcedar-14 起就已经存在,因此您无需添加该构建包.

Also you may check here if the library is not installed already on your server and what version. For example the imagemagick and ghostscript are already there since cedar-14 so you don't need to add that buildpack.

这篇关于如何在heroku应用程序中使用npm pdf图像包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆