Need Help!! Printing PDF file (Windows Service and Using Network Printer)

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
hello,
im using service that watch for pdf file and print it.
my code:
Process proc= new Process();
proc.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
proc.StartInfo.Verb ="print";
proc.StartInfo.FileName=".../Acrobat32.exe";
mailto:proc.StartInfo.Arguments=@"/p proc.StartInfo.Arguments=@"/p /t"+Filepath+" " + PrinterPath;
proc.StartInfo.UseShellExecute=false;
proc.StartInfo.CreateNoWindow=true;
proc.start();
proc.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
if(proc.HasExited==false)
{
proc.WaitForExit(30000);
}
proc.EnableRaisingEvents=true;
proc.CloseMainWindow();
proc.Close();

this code work but got some problems with consistence.
is there any idea how to improve this code.
Thanks

View the full article
 
Back
Top