This project has moved and is read-only. For the latest updates, please go here.

Running ghostcript from a non-standard install location

Dec 31, 2013 at 2:25 AM
I've placed a copy of the ghostscript 9.05 install under the Public user. Unfortunately when I try to read a PDF it fails unless I setup the registry with the values below.

Export from Regedit:

The bizarre part is if I set the same environment variables it doesn't seem to matter. Only the registry settings work. I'd like to be able to run my app without having admin rights to set the registry.
Dec 31, 2013 at 6:02 AM
Edited Dec 31, 2013 at 6:02 AM
You can also use HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE. At this moment there is no other way to accomplish this. I will have to make some changes to ImageMagick to allow that. Adding an environment variable called MAGICK_GHOSTSCRIPT_PATH to accomplish this sounds like a good idea.
Dec 31, 2013 at 6:02 PM
Edited Dec 31, 2013 at 6:07 PM
Thanks for the info about HKEY_CURRENT_USER. That fixes the administrative requirements, unfortunately it doesn't seem to work.

When I placed GS_DLL and GS_LIB in the same relative location in HKCU as HKLM I still get the "Magick: Postscript delegate failed" message.
Dec 31, 2013 at 7:43 PM
Have you tried to enable logging in MagickNET and set Debug to true in your MagickImage to receive more information?
Dec 31, 2013 at 9:51 PM
I'm not sure how to enable logging in Magick.NET or how to set Debug to true in MagickImage. Can you point me to some documentation?

Just for additional clarity:

I am able to run without any problems when the GS_DLL and GS_LIB options are placed in HKLM and when I remove them from the HKLM and put them here:

Then it fails and behaves the same whether I have them in HKEY_CURRENT_USER or not.
Jan 1, 2014 at 6:25 PM
Edited Jan 1, 2014 at 10:44 PM
This is a bug in ImageMagick and I will have to fix this for you. It only works if it can also the find the 'HKLM' version.

You can enable logging like this:
MagickNET.SetLogEvents(LogEvents.All); // LogEvents.All will show you the most information.
MagickImage image = LoadImage();
image.Debug = true;
The output will be written to the console and the debug window of visual studio. I am working on adding a Log event to the MagickNET class. I will add a page about this to the documentation when that is finished.
Jan 3, 2014 at 8:46 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.