Hi,
I'm trying to print a PDF my application. I would prefer to do it as silent as possible - no PrintDialogue | Adobe Reader Window.
Here´s some Code:
| public static void PrintPDF(string file, string printerName) | |
| { | |
| Process proc = new Process(); | |
| proc.StartInfo.FileName = @"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"; | |
| proc.StartInfo.Arguments = @" /t /h " + "\"" + file + "\"" + " " + "\"" + printerName + "\""; | |
| proc.StartInfo.UseShellExecute = true; | |
| proc.StartInfo.CreateNoWindow = true; | |
| proc.Start(); | |
| Thread.Sleep(1000); | |
| proc.WaitForInputIdle(); | |
proc.Kill(); | |
| } |
It works, but the Adobe Reader Window is still popping up -> /h (start the reader minimized) does not work.
Is there another way to hide the Window ?
Regards
Moved to Acrobat SDK
Hi,
I am developing an application, which have to support a PDF print. My result after searching for the best possibilities is this snippet:
| public static void PrintPDF(string path, string printer) | ||
| { | ||
| Process process = new Process(); | ||
| process.StartInfo.FileName = path; | ||
| process.StartInfo.Verb = "printto"; | ||
| process.StartInfo.Arguments = "\"" + printerName + "\""; | ||
process.Start();
// I have to use this in case of Adobe Reader to close the window | ||
| process.WaitForInputIdle(); | ||
| process.Kill(); | ||
| } |
This is the most generic solution - it prints a pdf unless no matter wich reader is installed.
Only deficit - the Adobe Reader window still pops up. Why it does not behave like it´s alternatives (for example Foxit Reader) and print the PDF without popping up ?
Regards
North America
Europe, Middle East and Africa
Asia Pacific