GhostScript dll

Nov 5, 2013 at 1:45 PM
Do we just need to copy the GhostScript dll to bin directory or do we actually need to have GhostScript installed on the machine?

Thanks
Coordinator
Nov 6, 2013 at 2:41 PM
Ghostscript library has to be installed on the machine.
Ghostscript.NET is a wrapper around the Ghostscript library.

Cheers,
Josip
Jan 16, 2014 at 8:56 PM
Is there any way to work around this, and be able to link to the ghostscript dll without having to install ghostscript on the machine?
Jan 20, 2014 at 10:52 AM
Is Ghostscript.NET a wrapper around GSDLL32.DLL the self-sufficient (stand-alone) binary implementation downloaded from the 'Ghostscript Downloads Page'? The full Ghostscript product does NOT need to be installed on the rollout machine in order to use this from a .NET 2003 application. I've tested this. Therefore, for .NET 2010, do we only need to rollout Ghostscript.NET.dll & GSDLL32.DLL with an app?
Jan 29, 2014 at 10:57 AM
Any news on this one?
Coordinator
Jan 29, 2014 at 4:18 PM
Correct, you can deploy only those two files and everything should work. The only issue you might run into with native Ghostscript library deployment is the Artifex Software Inc. licensing model (GPL).
Feb 4, 2014 at 1:48 PM
I tried deploying Ghostscript.NET.dll & GSDLL32.DLL with a VB.NET 2010 application to a 32-bit Windows 7 workstation where I work, without installing the full Ghostscript product. It produces this error:-

'This managed library is running under 32-bit process and requires 32-bit Ghostscript native library installation on this machine! To download proper Ghostscript native library please visit: http://www.ghostscript.com/download/gsdnld.html'

... but that's where I downloaded GSDLL32.DLL from in the first place? I'm confused. Any help would be greatly appreciated.

By the way it works if you install the full product on the roll-out machine, but I'm trying to avoid that.
Coordinator
Feb 4, 2014 at 2:39 PM
Edited Feb 4, 2014 at 2:47 PM
I assume that you use GhostscriptVersionInfo.GetLastInstalledVersion() function to get installed ghostscript libraries. The error you get is because mentioned method looks into the registry to collect all installed Ghostscript locations. If you want to use specific ghostscript dll that you are shipping with your application I would recommend you to do something like this:
GhostscriptVersionInfo gvi = new GhostscriptVersionInfo(new Version(0, 0, 0), @"e:\myapp\gsdll32.dll", string.Empty, GhostscriptLicense.GPL);
ghostscriptRasterizer.Open(@"e:\mytest.pdf", gvi);
or
GhostscriptProcessor ghostscriptProccessor = new GhostscriptProcessor(gvi);
or
ghostscriptViewer.Open(@"e:\mytest.pdf", gvi);
or you can pass dll as byte array like this:
string pathToGsDll = @"e:\myapp\gsdll32.dll";
byte[] gsDllBinary = System.IO.File.ReadAllBytes(pathToGsDll);
ghostscriptRasterizer.Open(@"e:\mytest.pdf", gsDllBinary);
or
GhostscriptProcessor ghostscriptProccessor = new GhostscriptProcessor(gsDllBinary);
ghostscriptProccessor.StartProcessing(...)
or
ghostscriptViewer.Open(@"e:\mytest.pdf", gsDllBinary);
I hope this helps.

Cheers,
Josip
Feb 5, 2014 at 9:12 AM
Many thanks for your help. That works nicely.