0
votes

Trying to play with ImageMagick to read scanned PDF texts, but at the point to convert the PDF to image, I've got this error, where it shows "no decode delegate for this image format `PDF' @ error/constitute.c/ReadImage/504". Been search for this solution for hours to no avail, need some help here.

OS: Windows 7 x64

ImageMagick Version: ImageMagick-6.9.8-10-Q16-x86-dll.exe

convert -list format

shows below output

   Format  Module    Mode  Description
-------------------------------------------

* native blob support
r read support
w write support
+ support for multiple images
1
Have you installed ghostscript (gs) with matching 32/64 bit-ness?Mark Setchell
You may have to modify your policy.xml file for the recent addition of a restriction on PDF files due to a Ghostscript bug that has subsequently been fixed. See stackoverflow.com/questions/52861946/…fmw42
@MarkSetchell, yes i do have ghostscript installed.ReverseEngineer
@fmw42, this does not work for me..ReverseEngineer
What do you get back for convert -version? What do you get for gs --version? If your output for convert -list format does not show anything further, then you have a problem with your install. It should list a lot of image formats.fmw42

1 Answers

0
votes

Looks like your delegates are not properly configured, Once Ghostscript is installed make sure the binary folder C:\Program Files/gs/gs3.0.9/bin is added to your path.

Once Done, there should be a file names delegates.mgk in you graphics magick home directory. Open that file in a text editor.

<delegate decode="pdf" encode="eps" mode="bi" command='"@PSDelegate@" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSEPSDevice@ "-sOutputFile=%o" -- "%i" -c quit' />

In the whole file, find and replace @PSDelegate@ with gswin64c and it should get the job done.