驱动打印

 public void DrivePrint(string filePath)
        {
            
string pdfPath = filePath;
            System.Drawing.Printing.PrintDocument pd 
= new System.Drawing.Printing.PrintDocument();
            Process processInstance 
= new Process();
            ProcessStartInfo startInfo 
= new ProcessStartInfo();
            startInfo.UseShellExecute 
= true;
            startInfo.Verb 
= "Print";
            startInfo.CreateNoWindow 
= true;
            startInfo.WindowStyle 
= ProcessWindowStyle.Hidden;
            startInfo.Arguments 
= @"/p /h \" + pdfPath + "\" \"" + pd.PrinterSettings.PrinterName + " \"";
            startInfo.FileName 
= pdfPath;
            processInstance.StartInfo 
= startInfo;
            processInstance.Start();
            processInstance.CloseMainWindow();
        }
posted @ 2011-05-04 15:42  ike_li  阅读(274)  评论(0编辑  收藏  举报