An error occured when call to 'gsapi_new_instance' is made

Here you can find everything you need to know about Dll-Files. You can also share your knowledge regarding the topic.

Moderators: DllAdmin, DLLADMIN ONLY

Post Reply
amitlal
Posts: 3
Joined: 25 Apr 2019, 07:36

An error occured when call to 'gsapi_new_instance' is made

Post 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();
}
}

DllAdmin
Site Admin
Posts: 426
Joined: 17 Mar 2011, 12:32
Contact:

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

Post 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

DllAdmin
Site Admin
Posts: 426
Joined: 17 Mar 2011, 12:32
Contact:

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

Post by DllAdmin »

gsdll32.dll v9.27 is now available for download in CLIENT and from https://www.dll-files.com/gsdll32.dll.html

amitlal
Posts: 3
Joined: 25 Apr 2019, 07:36

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

Post by amitlal »

Can you please let me know the creator of gsdll32.dll. I mean the contact information to know if it supports multithreading.


amitlal
Posts: 3
Joined: 25 Apr 2019, 07:36

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

Post by amitlal »

Thanks admin for your time and support

Post Reply