0

I was trying to convert a pdf to images using a python script and Wand with ImageMagick bindings. But, I really want to avoid using Ghostscript? Is it possible to do because the installation of Wand doesn't mention anything about Ghostscript but it seems that it is mandatory to have the conversion from pdf to an image using python. Has anyone tried doing the same?

There is also a similar issue open in the Wand git repo (https://github.com/dahlia/wand/issues/319). This means that it is really not possible to convert pdf to png without Ghostscript?

Can this be an issue based on OS and ImageMagick version? I am using MacOS and ImageMagick@6. For some reason, I was not able to run the latest ImageMagick(7.1) on Mac. So, if anyone has tried on a different OS or with latest version of ImageMagick, inputs are welcome.

mon_ml
  • 91
  • 5

1 Answers1

0

ImageMagick ultimately pipes out to Ghostscript for the conversion.

And poorly as well. I just had this issue a few months ago in PHP script, where crystal reports created badly formed PDF files, that ImageMagick attempts to fix, and throws a java error, but Ghostscript can convert it just fine if ImageMagick is bypassed.

Execute ghostscript with this command line -dJPEGQ=95 -r600 -dNOPAUSE -q -sDEVICE=jpeg -dBATCH -sOutputFile="OutputImage_%d.jpeg" "SourcePDFPath.pdf" to turn a PDF into multiple jpegs

Trevor
  • 2,792
  • 1
  • 30
  • 43