Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick Errors: Convert PDF to Images

When I run the following command to convert a PDF to Image using ImageMagic Convert util with the following parameters :

C:\Windows\system32>"C:\Program Files\ImageMagick-6.5.8-Q16\convert.exe" "D:\RealDocs.pptx.pdf" "d:\hello.jpg"

I get the following error :

convert.exe: `%s': %s "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=C:/Users/Nupitch/AppData/Local/Temp/magick-xwOF7jbV" "-fC:/Users/Nupitch/AppData/Local/Temp/magick-BescEsek" "-fC:/Users/Nupitch/AppData/Local/Temp/magick-XfLll9WM" @ utility.c/SystemCommand/1964.convert.exe: Postscript delegate failed `D:\RealDocs.pptx.pdf': No such file ordirectory @ pdf.c/ReadPDFImage/634.convert.exe: missing an image filename `d:\hello.jpg' @ convert.c/ConvertImageCommand/2838.

please help me ~

like image 345
Thomas Avatar asked Jul 06 '11 02:07

Thomas


1 Answers

ImageMagick cannot handle PostScript and PDF files itself and by its own. For this it uses a third party software called Ghostscript as a 'delegate'.

Has your Windows system Ghostscript installed properly? Or is not installed at all?

Try to download and install the latest version from here.

Probably you'd get a different error message if the problem is caused by a missing Ghostscript installation. But your error is:

D:\RealDocs.pptx.pdf': No such file or directory 
@ pdf.c/ReadPDFImage/634.convert.exe: missing an image filename `d:\hello.jpg' 

This could mean that the user account you run this command under does not have permission to write to the root of the D: drive.

To test this, you could run the conversion command in a cmd.exe window in a slightly modified way:

 "C:\Program Files\ImageMagick-6.5.8-Q16\convert.exe" ^
      "D:\RealDocs.pptx.pdf" ^
      "%userprofile%\hello.jpg"

(On Windows XP, %userprofile% usually points to c:\documents and settings\<your username>\...)

like image 197
Kurt Pfeifle Avatar answered Oct 16 '22 16:10

Kurt Pfeifle