This project is read-only.

GhostScript dll

Nov 5, 2013 at 2: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?

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

Jan 16, 2014 at 9: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 11: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 11:57 AM
Any news on this one?
Jan 29, 2014 at 5: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 2: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:'

... 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.
Feb 4, 2014 at 3:39 PM
Edited Feb 4, 2014 at 3: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);
GhostscriptProcessor ghostscriptProccessor = new GhostscriptProcessor(gvi);
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);
GhostscriptProcessor ghostscriptProccessor = new GhostscriptProcessor(gsDllBinary);
ghostscriptViewer.Open(@"e:\mytest.pdf", gsDllBinary);
I hope this helps.

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