Ghostscript.NET icon indicating copy to clipboard operation
Ghostscript.NET copied to clipboard

Silently Print

Open qqw1943 opened this issue 2 years ago • 3 comments

hello. i am a new c# learner. when i try to print a pdf file using the example below:

using (GhostscriptProcessor processor = new GhostscriptProcessor())
           {
               List<string> switches = new List<string>();
               switches.Add("-empty");
               switches.Add("-dPrinted");
               switches.Add("-dBATCH");
               switches.Add("-dNOPAUSE");
               switches.Add("-dNOSAFER");
               switches.Add("-dNumCopies=1");
               switches.Add("-sDEVICE=mswinpr2");
               switches.Add("-sOutputFile=%printer%" + printerName);
               switches.Add("-f");
               switches.Add(inputFile);

               processor.StartProcessing(switches.ToArray(), null);
           }

there's always a dialog (see pic in attach files). but i need a Silently Print,which means no dialog is needed can i get some help here ? thank you. QQ截图20220411180751

qqw1943 avatar Apr 11 '22 10:04 qqw1943

same problem here

brothers-morrison avatar Jul 05 '22 14:07 brothers-morrison

same problem here,can you give me some advice

litao198610 avatar Oct 19 '22 08:10 litao198610

Hi ist late, but maybe it still helps.

The Pirntername has spaces!

Try to use switches.Add("-sOutputFile=\"%printer%" + printerName + "\"" );

MAButz avatar May 24 '23 07:05 MAButz