The new exception says
An unhandled exception of type 'ImageMagick.MagickCoderErrorException' occurred in Magick.NET-Q8.Wrapper-x86.dllAll my code from main:
Additional information: PDF PoC Revisited.vshost.exe: WriteBlob Failed `c:\users\xxxx\documents\visual studio 2013\Projects\PDF PoC Revisited\PDF PoC Revisited\bin\Debug\Image Extract\Terms of Service.Page1.150DPI.png' @ error/png.c/MagickPNGErrorHandler/1650
var imageOutputDpi = 150;
var magickSettings = new MagickReadSettings();
magickSettings.Density = new PointD(imageOutputDpi, imageOutputDpi);
magickSettings.Format = MagickFormat.Png;
magickSettings.ColorSpace = ColorSpace.GRAY;
using(var imageCollection = new MagickImageCollection())
{
var assemblyLocation = Assembly.GetExecutingAssembly().Location;
var assemblyDirectory = assemblyLocation.Remove(assemblyLocation.LastIndexOf('\\') + 1);
var pdfFileName = "Terms of Service Agreement 2014";
var pdfLocation = string.Format("{0}{1}{2}", assemblyDirectory, pdfFileName, ".pdf"); //[Assembly Directory]\Terms of Service Agreement 2014.pdf
if (File.Exists(pdfLocation)) imageCollection.Read(pdfLocation, magickSettings);
var outputFolderName = "Image Extract";
var pdfOutputDirectory = string.Format("{0}{1}\\", assemblyDirectory, outputFolderName); //[Assembly Directory]\Image Extract\
var pdfOutputPostfixFormat = ".Page{0}.{1}DPI";
var pageNumber = 1;
foreach (var image in imageCollection)
{
var pdfOutputPostfix = string.Format(pdfOutputPostfixFormat, pageNumber, imageOutputDpi); //.Page1.150DPI
var imageOutputLocation = string.Format("{0}{1}{2}{3}", pdfOutputDirectory, "Terms of Service", pdfOutputPostfix, ".png"); //[Assembly Directory]\Image Extract\Terms of Service.Page1.150DPI.png
image.Write(imageOutputLocation);
pageNumber++;
}
}
Console.WriteLine("done");
Console.Read();