This project is read-only.

An error occured when call to 'gsapi_init_with_args' is made: -15

Nov 20, 2013 at 9:54 PM
i am getting following error when i try to open a .ps file.

An error occured when call to 'gsapi_init_with_args' is made: -15

is there anything i am missing.
Nov 21, 2013 at 6:38 AM
Edited Nov 21, 2013 at 6:39 AM
-15 is a "Range check" error.

Can you please post the code you are using and email me the postscript file that raises this error?

email: habjan(at)
Nov 22, 2013 at 2:39 PM
Is there any version requirements of ghost script dll. looks like when i use 8.64 i am getting the error. When i installed 9.10, it is not giving any error, but the viewer not opening the ps or pdf file. I tried rasterizer, it works fine.
Nov 22, 2013 at 3:06 PM
Can you please email me the PDF you want to use in viewer? It could be there is some bug in the Viewer as Rasterizer is based on Viewer. PDF sample file would help me to debug and to fix this issue.

Nov 22, 2013 at 3:14 PM
Attached are the pdf and ps files that i am trying to open.


Nov 26, 2013 at 7:47 AM
Just to let other people know. that issue is solved by installing latest version of the Ghostscript library.

Nov 27, 2013 at 4:29 PM
To recount the issue and resolution:
I was getting the -15 error when i try to use the 8.15 version of the ghost script. When I upgraded it to the latest version (9.10) everything works great. The error occurred "gsapi_init_with_args" method so i am thinking it is something to do with API change on the parameters.
If you decided to load the dll into the memory without actually having the install being there in the system. A method like
  gsviewer.Open(@"D:\mytest.pdf", System.IO.File.ReadAllBytes(@"C:\ProgramFiles\ApplicationName\gs32dll.dll")); 
will work great.
Thanks josip for the help.