Quantcast
Channel: Ghostscript.NET
Viewing all articles
Browse latest Browse all 393

New Post: GhostScript dll

$
0
0
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

Viewing all articles
Browse latest Browse all 393

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>