postscript to file only

Dec 9, 2013 at 4:04 PM
Does anyone have a sample of code that simply creates a pdf file from a ps file without displaying it?
Coordinator
Dec 9, 2013 at 5:52 PM
Edited Dec 9, 2013 at 5:55 PM
Hi,

Take a look at this sample:
    using Ghostscript.NET.Processor;


    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("-sDEVICE=pdfwrite");
    switches.Add("-sOutputFile=" + @"E:\testoutput.pdf");
    switches.Add("-f");
    switches.Add(@"E:\testinput.ps");

    using (GhostscriptProcessor processor = new GhostscriptProcessor())
    {
        processor.StartProcessing(switches.ToArray(), null);
    }