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

Running Magick.net with only gsdll32.dll

Feb 21, 2014 at 11:52 PM
Edited Feb 21, 2014 at 11:55 PM
Greetings!

I was wondering if there is a way to use Magick.Net without having to also install Ghostscript. I would like to be able to use Magick.Net (which by the way is an awesome tool! Thank you!) to generate PDFs overlayed with other PDFs. So far from what I have been learning is that I can only do this by having Ghostscript installed.

I would much rather be able to refer to the DLL itself. I have been able to use Magick.Net with Ghostscript installed, but that would be a cumbersome option for eventual deployment. The DLLs themselves cannot be referenced from within Visual Studio because they are C libraries (from what I have read). Bringing them in via kernal32 LoadLibrary does not seem to work either. The error that I receive when I try to instanciate a MagickImage("somefile.pdf") object is a StackOverflowException and the app stops.

Is what I am describing poossible?

Thanks again for this tool. It does a great job!

-Greg
Coordinator
Feb 22, 2014 at 10:21 AM
Edited Feb 22, 2014 at 10:23 AM
Can you be provide me with a stacktrace or a crashdump (contact me through CodePlex to get my e-mail address). I would really like to fix this but I am unable to reproduce the StackOverflowException you and other people have been reporting.

I have made a change to ImageMagick that will allow you to define the directory that will be used to load 'gsdll32/64.dll' from. The next version of Magick.NET will include this setting. You will be able to do the following:
MagickNET.SetGhostscriptDirectory(@"D:\gs\bin");
using(MagickImage image = new MagickImage("somefile.pdf"))
{
  image.Write("somefile.png");
}
Coordinator
Feb 22, 2014 at 10:25 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 23, 2014 at 5:07 PM
Hey there!

I'm pulling down your code and will get it setup so that I can debug into it and get a proper stack trace for you.

I did a little experimenting installing and uninstalling gs9.10. It is clear that the exception occurs when gs9.10 is not installed, but I wanted to see if the exception would go away if the DLL was in it's expected place even if being uninstalled. I uninstalled and had a copy of the bin/ folder that contained gsdll32.dll that I put back in place where it was when g29.10 was installed. No luck, I still get the same exception.

I'll get back t you asap. I have a bunch of things to do around the ranch today, but I'll have a spot of time.

Thanks for your help!

-Greg