GhostscriptAPICallException

Apr 29, 2014 at 1:26 AM
Edited Apr 29, 2014 at 1:32 AM
Hello Friend

Before to nothing. Thanks for this project, is amazing!

I tried to run the processor sample I modified the code with mine, but I don't get success run, I can't create a new file. I hope you can help me to figure what is wrong. In this line sometimes the program stops and sometimes does nothing
       if (ierrors.IsError(rc_ins))
        {
            throw new GhostscriptAPICallException("gsapi_new_instance", rc_ins);
        }
I have windows 7 64-bits and I have 32 and 64 bits Ghostscript program

Below is my code

Thanks in advance
        string inputFile = @"D:\371591\Dev\Net\SISCA_V2\sisca\sisca\Temporales\pdf20140428181426.pdf";
        string outputFile = @"D:\371591\Dev\Net\SISCA_V2\sisca\sisca\Temporales\pdf20140428181426_nuevo.pdf";

        GhostscriptVersionInfo gv = GhostscriptVersionInfo.GetLastInstalledVersion(
            GhostscriptLicense.GPL | GhostscriptLicense.AFPL, 
            GhostscriptLicense.GPL);

        using (GhostscriptProcessor processor = new GhostscriptProcessor(gv, true))
        {
            processor.Processing += new GhostscriptProcessorProcessingEventHandler(processor_Processing);

            List<string> switches = new List<string>();                              

            switches.Add("-sDEVICE=pdfwrite");
            switches.Add("-dCompatibilityLevel=1.4");
            switches.Add("-dPDFSETTINGS=/default");
            switches.Add("-dNOPAUSE");
            switches.Add("-dQUIET");
            switches.Add("-dBATCH");
            switches.Add(@"-sOutputFile=" + outputFile);
            switches.Add(@"-f");
            switches.Add(inputFile);

            processor.StartProcessing(switches.ToArray(), null);
Apr 29, 2014 at 3:59 PM
Thanks

I solved
Coordinator
Apr 29, 2014 at 6:47 PM
Hi,

I'm glad you solved your problem.

Would you be so kind to share your solution with others?

Thanks,
Josip