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

New Post: Additional information: An error occured when call to 'gsapi_new_instance' is made: -100

$
0
0
I had the same issue in a winform app.
The cause was I was reusing a single GhostscriptViewer instance to open multiple documents. Even creating a new instance for each pdf was throwing the exception when the garbage collector didn't had enough time to dispose the unmanaged resources. I ended up by creating a private member variable to hold the GhostscriptViewer and before opening a new pdf I disposed the viewer if it was not null:
private GhostscriptViewer gsViewer;
// ...

 if(this.gsViewer != null)
    this.gsViewer.Dispose();
this.gsViewer = new GhostscriptViewer();
poz

Viewing all articles
Browse latest Browse all 393

Trending Articles