驱动打印
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();
}
{
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();
}