mooz / node-pdf-image

Provides an interface to convert PDF's pages to png files in Node.js by using ImageMagick
MIT License
237 stars 87 forks source link

Failed to execute command "gs" #32

Open sluchznak opened 6 years ago

sluchznak commented 6 years ago

Hi!

Error: Command failed: convert -density 200 -quality 100 '/tmp/104ace3110aa-The Barns_Concept Package.pdf[3]' '/tmp/104ace3110aa-The Barns_Concept Package-3.png'
convert: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r200x200" -dUseCIEColor -dFirstPage=4 -dLastPage=4 "-sOutputFile=/tmp/magick-13949BwzUAbLfdxbw%d" "-f/tmp/magick-13949stObhdbHGuEB" "-f/tmp/magick-13949n1rt6bTsCP7G"\' (-1) @ error/delegate.c/ExternalDelegateCommand/461.\nconvert: no images defined `/tmp/104ace3110aa-The Barns_Concept Package-3.png\' @ error/convert.c/ConvertImageCommand/3210.\n
pkantsedalov commented 5 years ago

I've found some workaround of that - look at this comment please.

rainabba commented 5 years ago

@sluchznak The installation instructions make it clear that the gs command must be available and it's provided by ghostscript. Have you installed it and confirmed with which gs and/or gs --help? You should see something like this:

linuxbrew@7d4cb3ce397e:/usr/src$ which gs /home/linuxbrew/.linuxbrew/bin/gs linuxbrew@7d4cb3ce397e:/usr/src$ gs --help GPL Ghostscript 9.26 (2018-11-20)

The tip from @pkantsedalov comes into play once that's working from what I've seen so far.