Conversation
Encapsulate filenames with spaces in double quotes on resp.data (line 58).
|
Unfortunately this change can't be automatically merged. It looks like your current branch is a little newer than what is on npm: https://www.npmjs.com/package/pdf2png-mp. However, the change I made is minor. Line 36 can be updated with:
instead of:
After some tinkering, this change allowed me to process filenames with whitespace in the name. If you are curious, I am using your npm module for my on project to convert and OCR pdfs: |
updated read and package.json. also removed some console.log statements that were used for debugging.
|
Hello @Inkognitoo . Thank you for this wonderful module. This works just fine with windows with a node app but with Linux on heroku using a node app, it seems to not work. I am not even getting any console.logs to see what's breaking. I installed gs through a buildpack https://github.com/nurveteam/heroku-buildpack-ghostscript which uses ghostscript 9.20 and set the $PATH env too. It still doesn't seem to work. Any advice or inputs o this would be appreciated. Thanks. Sumant |
Encapsulate filenames with spaces in double quotes on resp.data (line
58).
was:
exec("gs -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r" + options.quality + " -dFirstPage=1 -dLastPage=1 -sOutputFile=" + imageFilepath + " " + resp.data, function (error, stdout, stderr) {
is now:
exec("gs -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r" + options.quality + " -dFirstPage="+i+" -dLastPage="+i+" -sOutputFile=" + imageFilepath + " " + '"' + resp.data + '"', function (error, stdout, stderr) {