Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silently Print #99

Open
qqw1943 opened this issue Apr 11, 2022 · 3 comments
Open

Silently Print #99

qqw1943 opened this issue Apr 11, 2022 · 3 comments

Comments

@qqw1943
Copy link

qqw1943 commented Apr 11, 2022

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

@brothers-morrison
Copy link

same problem here

@litao198610
Copy link

same problem here,can you give me some advice

@MAButz
Copy link

MAButz commented May 24, 2023

Hi ist late, but maybe it still helps.

The Pirntername has spaces!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants