how to use npm pdf image package in heroku app

╄→гoц情女王★ 提交于 2021-01-27 07:51:54

问题


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).

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.

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.

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?

Thank you!


回答1:


Depends on what heroku stack you're using.

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

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

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.



来源:https://stackoverflow.com/questions/60234991/how-to-use-npm-pdf-image-package-in-heroku-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!