I'm using Magick.NET for converting images(.PS format to .PNG), Internally Magick.NET uses Ghostscript to convert .ps files. Is there a way to add reference to Ghostscript's DLLs without installing it. PS: I'm using ASP.NET MVC4
Asked
Active
Viewed 3,438 times
4
1 Answers
6
It should be possible to use Ghostscript without installing it. You should first download and install Ghostscript on your own machine. If you want to use the x64 version of Magick.NET you should install the x64 version of Ghostscript. You need to install it because you need to copy the file gsdll64.dll or gsdll32.dll to your application. I have not tested this so you might have to copy the dll into your bin directory before it works. You could try to place it outside the bin directory first.
Before you use Magick.NET in your application make sure you do the following call:
MagickNET.SetGhostscriptDirectory(@"c:\directory\where\you\put\the\dll\of\ghostscript");

dlemstra
- 7,813
- 2
- 27
- 43
-
I needed the bin folder no matter where it was installed – Nate- Jul 14 '16 at 21:00
-
2`string binDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);` `int i = binDir.IndexOf(':');` `binDir = binDir.Substring(i + 2);` `MagickNET.SetGhostscriptDirectory(binDir);` – Nate- Jul 14 '16 at 21:02
-
There is probably a more succinct way of doing this. -- sorry that i cannot format code better in a comment – Nate- Jul 14 '16 at 21:02
-
2Thank you, What about when using Ghostscript.net dll (it needs also gs installed) I tried to copy dll to bin folder, no results it needs installing – Emin Hasanov Aug 18 '17 at 15:03
-
I think you should tell Magick.NET where the file is located with the code below. For detail information you can look at here: https://github.com/dlemstra/Magick.NET/tree/master/docs – malik masis May 21 '20 at 10:32