This project has moved. For the latest updates, please go here.

Output directory for MagickImageCollection.Write

Apr 27, 2016 at 7:25 PM
I am using Magick.NET-Q16-AnyCPU and Ghostscript 0.16 x64 to extract the first page of PDF as a PNG file. I have gotten it to work but I want to set the directory where the PNG file is getting written. How do I set the default directory for output?
Coordinator
Apr 27, 2016 at 8:35 PM
Edited Apr 27, 2016 at 8:37 PM
You can specify a full path as the fill name when you call the .Write method:
image.Write(@"c:\the\directory\where\you\want\it\page1.png");
p.s. You are using MagickImage.Write to write a single page right?
Apr 27, 2016 at 9:21 PM
Here is what I am doing:
            MagickReadSettings settings = new MagickReadSettings();
            settings.Density = new Density(300, 300);
            settings.FrameIndex = 0;
            settings.FrameCount = 1;
            MagickImage image = new MagickImage(fileName, settings);
            image.Write(@"c:\dev\Sample.Page1" + page + ".png");
Output file is ending up here:
C:\Program Files (x86)\IIS Express
This path is not defined anywhere that I can find.
Coordinator
Apr 27, 2016 at 9:52 PM
I am unable to reproduce your issue. The file gets written to c:\dev. Are you able to share a small program on something like DropBox that can be used to reproduce the issue?