Page 1 of 1

[RESOLVED] Can't convert from pdf to png

Posted: 2018-11-27T14:13:25-07:00
by letmeconvert
I am using Win10.

This is my IM version:
"magick --version
Version: ImageMagick 7.0.8-14 Q16 x64 2018-10-24 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib"

If I try to convert with
"magick.exe -density 300 output.pdf output.png"
I just get
"magick.exe: FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" "-sOutputFile=C:/Users/One/AppData/Local/Temp/magick-7932g538CkzkOdAI%d" "-fC:/Users/One/AppData/Local/Temp/magick-7932pIZ3zvgme0fK" "-fC:/Users/One/AppData/Local/Temp/magick-7932MtoegBu23Flb"' (Das System kann die angegebene Datei nicht finden.
) @ error/delegate.c/ExternalDelegateCommand/475.
magick.exe: PDFDelegateFailed `Das System kann die angegebene Datei nicht finden.
' @ error/pdf.c/ReadPDFImage/795."

I tried different filenames and convert, I am also sure there is a output.pdf in the folder I am executing the commands.
What am I missing?

Re: Can't convert from pdf to png

Posted: 2018-11-27T14:21:17-07:00
by snibgo
I suspect you haven't installed Ghostscript.

Re: Can't convert from pdf to png

Posted: 2018-11-27T15:25:50-07:00
by letmeconvert
snibgo wrote: 2018-11-27T14:21:17-07:00 I suspect you haven't installed Ghostscript.
What is that and where do I get it?

Re: Can't convert from pdf to png

Posted: 2018-11-27T15:56:10-07:00
by dlemstra

Re: Can't convert from pdf to png

Posted: 2018-11-27T17:24:00-07:00
by fmw42
You have Ghostscript as indicated by gslib

"magick --version
Version: ImageMagick 7.0.8-14 Q16 x64 2018-10-24 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib"

But there have been recent policy changes that restrict reading of PDF files due to a Ghostscript bug that has subsequently been fixed. You may want to download the latest Ghostscript.

To fix the issue you need to edit your policy.xml file

See https://stackoverflow.com/questions/528 ... 3#52863413

Re: Can't convert from pdf to png

Posted: 2018-11-28T11:56:15-07:00
by letmeconvert
Thanks guys.
I installed ghostscript and added the line to policy.xml, and now it works.

Also the ghostscript license doesn't seem to be too bad, every client can just install their own version of ghostscript, so my use case won't break their policy if I understood it correctly.

Im farily new here so I don't know how to set a post to answered if there is a way to do that.

Re: Can't convert from pdf to png

Posted: 2018-11-28T12:14:27-07:00
by fmw42
You just edit your top original post's title. I will do it for you this time.