thnew / Pdf2Png

A NodeJS module, converting PDFs to PNG
27 stars 30 forks source link

GPL Ghostscript 9.52: Unrecoverable error #15

Open donniekerr opened 4 years ago

donniekerr commented 4 years ago

Any ideas on what might be causing this error? Something went wrong: Error reading pdf: Error: Command failed: gs -q -dNODISPLAY -c "(/Users/donniekerr/Documents/work/pdf2png/pdf2png/input/W-4-KERR.pdf) (r) file runpdfbegin pdfpagecount = quit" [5/15/20 4:06:53 PM] GPL Ghostscript 9.52: Unrecoverable error, exit code 1

Houkouki commented 3 years ago

Ghostscript (as of version 9.28) defaults to SAFER being active. Try adding the -dNOSAFER parameter just like this: gs -q -dNOSAFER -dNODISPLAY -c "(/Users/donniekerr/Documents/work/pdf2png/pdf2png/input/W-4-KERR.pdf) (r) file runpdfbegin pdfpagecount = quit" Have a look at Ghostscript's command line options for further reference. (You might want to check -dSAFER and -dNOSAFER in particular)