Page 1 of 1

An error occured when call to 'gsapi_new_instance' is made

Posted: 25 Apr 2019, 07:50
by amitlal
I am trying to use GhostscriptRasterizer to create image of PDF files uploaded.

For this I am making my code async to avoid delay to enduser and complete the fileupload and image generation using threadpool. But this is only working if I am uploading single file.

When ever I try to upload more than one PDF file it gives me error in the method call "rasterizer.Open(input, version, false);"

And the error message displayed is
1. "An error occured when call to 'gsapi_new_instance' is made: -100".

2. Delegate of an exported function couldn't be created for symbol 'gsapi_revision' (Error in different machine)

I have provided the code I am using below and I am using 32bit dll.

Please provide me immediate solution for this. And if GhostscriptRasterizer supports multithreading?

Codeset
private void PdfToImage(string input, string imgFolderPath, int dpi)
{
var path = AssemblyDirectory;

Ghostscript.NET.Rasterizer.GhostscriptRasterizer rasterizer;
var version = new GhostscriptVersionInfo(new Version(0, 0, 0), path + @"\gsdll32.dll", string.Empty, GhostscriptLicense.GPL);

using (rasterizer = new Ghostscript.NET.Rasterizer.GhostscriptRasterizer())
{

rasterizer.Open(input, version, false);
var pageFilePath = Path.Combine(imgFolderPath, string.Concat(Path.GetFileNameWithoutExtension(input), ".jpg"));
var img = rasterizer.GetPage(dpi, dpi, 1);
img.Save(pageFilePath, ImageFormat.Jpeg);
rasterizer.Close();
}
}

Re: An error occured when call to 'gsapi_new_instance' is ma

Posted: 25 Apr 2019, 09:23
by DllAdmin
Hello amitlal,

I can not tell if the gsdll32.dll available at https://www.dll-files.com/gsdll32.dll.html supports multithreading.

Perhaps you need a different version of gsdll32.dll .

Perhaps you can find different versions, and support, at https://www.ghostscript.com/download.html

Best regards
Erik
DLL-Files.com

Re: An error occured when call to 'gsapi_new_instance' is ma

Posted: 25 Apr 2019, 10:11
by DllAdmin
gsdll32.dll v9.27 is now available for download in CLIENT and from https://www.dll-files.com/gsdll32.dll.html

Re: An error occured when call to 'gsapi_new_instance' is ma

Posted: 25 Apr 2019, 10:37
by amitlal
Can you please let me know the creator of gsdll32.dll. I mean the contact information to know if it supports multithreading.

Re: An error occured when call to 'gsapi_new_instance' is ma

Posted: 25 Apr 2019, 10:50
by DllAdmin

Re: An error occured when call to 'gsapi_new_instance' is ma

Posted: 26 Apr 2019, 07:57
by amitlal
Thanks admin for your time and support