ArtifexSoftware / Ghostscript.NET

Ghostscript.NET - managed wrapper around the Ghostscript library (32-bit & 64-bit)
https://ghostscript.com
GNU Affero General Public License v3.0
395 stars 152 forks source link

Facing an Issue "An error occured when call to 'gsapi_init_with_args' is made: -100" While converting ps to PNG #53

Closed Sureshgoudb closed 3 years ago

Sureshgoudb commented 6 years ago
        GhostscriptPipedOutput gsPipedOutput = new GhostscriptPipedOutput();
        string outputPipeHandle = "%handle%" + int.Parse(gsPipedOutput.ClientHandle).ToString("X2");
        using (GhostscriptProcessor processor = new GhostscriptProcessor())
        {
            List<string> switches = new List<string>();
            switches.Add("-empty");
            switches.Add("-dQUIET");
            switches.Add("-dSAFER");
            switches.Add("-dBATCH");
            switches.Add("-dNOPAUSE");
            switches.Add("-dNOPROMPT");
            switches.Add("-dNumCopies=1");
            switches.Add("-sDEVICE=pngalpha");
            switches.Add("-o" + outputPipeHandle);
            switches.Add("-sOutputFile=C:\\Converted.png");
            switches.Add(PSFile);
            processor.StartProcessing(switches.ToArray(), null);
          }
Luke-Meyer commented 4 years ago

What version of .Net were you using when you encountered this? I am seeing similar issues on .Net Core 2.1 and am wondering if targeting the .Net framework (4.6.1 or something similar) would fix it.

jhabjan commented 3 years ago

Fixed in today's v.1.2.2. release.