Shubh
Shubh

Reputation: 19

When using Ghostscript library, does Ghostscript need to be installed on the user machine?

I want to use Ghostscript managed library in .NET C#. Does this needs Ghostscript to installed on the machine.

Cant we include this gsdll32.dll in my test application as reference to remove this dependency?

Upvotes: 1

Views: 2195

Answers (3)

KenS
KenS

Reputation: 31159

If you are including Ghostscript as part of your application you must abide by the terms of the AGPL. This means your own application must be AGPL licenced, or you must seek a commercial licence.

If you supply the Ghostscript libraries, without including the licence and details of where the Ghostscript source can be obtained, then you are in violation of the licence.

And yes, this covers just the DLLs. Shubh it sounds to me (since you talk about 'your application') like you are violating the licence, unless your application is also licenced under the AGPL of course.

Upvotes: 0

Gustavo F
Gustavo F

Reputation: 2206

Yes, I use this code to call the DLL and not be forced to install ghostscript (works on x86 and x64 machines):

const string DLL_32BITS = "gsdll32.dll";
const string DLL_64BITS = "gsdll64.dll";

//select DLL based on arch
string NomeGhostscriptDLL;
if (Environment.Is64BitProcess)
{
    NomeGhostscriptDLL = DLL_64BITS;
}
else
{
    NomeGhostscriptDLL = DLL_32BITS;
}

GhostscriptVersionInfo gvi = new GhostscriptVersionInfo(NomeGhostscriptDLL);

using (var rasterizer = new GhostscriptRasterizer())
{
    rasterizer.Open(e.FullPath, gvi, true);

    and so on...

P.S.: Remember to copy both dll's to output directory

Upvotes: 1

Emin Hasanov
Emin Hasanov

Reputation: 1362

Yes you can bypass installing GhostScript. You can put gs32.dll or gs64.dll and everywhere but you should add HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.21 registry key:

  • GS_DLL Path to your gs32.dll file
  • GS_LIB path to your Library = this is Libraries\GS\Fonts from your setup.

It is better install with setup, copy usual files, then change registry and uninstall. Of course by uninstalling you will lose your registry entries (just rename before)

Upvotes: 0

Related Questions