PDF->PNG conversion failing

May 30, 2013 at 1:30 PM
I have a simple app that converts a few thousand PDF files to images. When I run a process using the imagemagick installed on my machine, everything is fine. When I try to use Magick.net I get the following error:

Unhandled Exception: ImageMagick.MagickDelegateErrorException: mmlToPDF.exe: PostscriptDelegateFailed `C:\Users...\Desktop\img\eqn_.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/682
at ImageMagick.MagickReader.Read(Image* image, String fileName, MagickReadSettings readSettings)
at ImageMagick.MagickImage..ctor(String fileName)

Which looks very much like the common GhostScript installation error. I do however have GS 9.0.7 installed, so is there a particular version of GS I should be using or some initialization required for GS through Magick.net?

Alternatively, can anyone tell what am I doing wrong here.
(Initialize() has been called earlier, intFiles is List<string> containing the PDF file names)

foreach (string pdfFile in intFiles)
{
string imgFile = Path.ChangeExtension(pdfFile, imgType);
MagickImage img = new MagickImage(pdfFile);
img.Density = new MagickGeometry(300, 300);
img.Quality = 100;
img.Trim();
img.Write(imgFile);
}
May 31, 2013 at 8:09 AM
Take a look at the url below and see if that helps you:
https://magick.codeplex.com/workitem/963
Coordinator
Jun 1, 2013 at 3:26 PM
Edited Jun 1, 2013 at 5:19 PM
Thanks for reminding me to post something about the GhostScript issues. I added a wiki page that explains which version of GhostScript you should install and how you can convert a PDF to an image here: https://magick.codeplex.com/wikipage?title=Convert%20PDF&referringTitle=Documentation.
Jun 3, 2013 at 7:23 AM
@petersunde - Thanks for the pointer and @dlemestra for the wiki page.
Spot on, the problem was a 64 bit version of GhostScript.