Jayahe
Jayahe

Reputation: 137

How to run python package pdf2image in Heroku: not working

I am trying to run python dash application in Heroku. Since I am using pdf2image package that also has a dependency with poppler, working fine in my dev environment but when I deploy the same in Heroku, my code is getting stuck at this point: without any progress

PDF to Image conversion started for file: HH689
2020-09-13T19:32:48.177754+00:00 app[web.1]: convert from path
2020-09-13T19:32:48.198294+00:00 app[web.1]: 10.52.12.238 - pdfocr [13/Sep/2020:19:32:48 +0000] "POST /_dash-update-component HTTP/1.1" 500 290 "https://pdf-text-ocr.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"
2020-09-13T19:32:48.199716+00:00 heroku[router]: at=info method=POST path="/_dash-update-component" host=pdf-text-ocr.herokuapp.com request_id=1b268520-1ca8-464b-8256-0dfa2c5c7f5d fwd="49.206.3.8,165.225.124.180" dyno=web.1 connect=0ms service=24ms status=500 bytes=470 protocol=https

I have also added all the necessary buildpacks; poppler, imagemagick and ghost script in the path.

enter image description here

Upvotes: 0

Views: 574

Answers (1)

Jayahe
Jayahe

Reputation: 137

Check the Heroku package you are using; package details In case you are using Heroku 18, you will have Imagemagick and Ghost script by default installed in your package. Not necessary to add buildpacks additionally.

only add this poppler buildpack which is compatible with Heroku 18:

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

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

Regards,

Upvotes: 1

Related Questions