【发布时间】:2021-04-12 13:46:43
【问题描述】:
我们用 c# 打印 pdf 文件。工作正常,但有没有机会设置份数 某处?我不想要循环。
ProcessStartInfo infoPrintPdf = new ProcessStartInfo();
infoPrintPdf.FileName = filename;
// The printer name is hardcoded here, but normally I get this from a combobox with all printers
string printerName = druckerS;
string driverName = "printqueue.inf";
string portName = "192.168.0.119";
infoPrintPdf.FileName = @"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe";
infoPrintPdf.Arguments = string.Format("/t {0} \"{1}\" \"{2}\" \"{3}\"",
filename, printerName, driverName, portName);
infoPrintPdf.CreateNoWindow = true;
infoPrintPdf.UseShellExecute = false;
infoPrintPdf.WindowStyle = ProcessWindowStyle.Maximized;
Process printPdf = new Process();
printPdf.StartInfo = infoPrintPdf;
printPdf.Start();
System.Threading.Thread.Sleep(10000);
if (!printPdf.CloseMainWindow()) // CloseMainWindow never seems to succeed
printPdf.Kill(); printPdf.WaitForExit(); // Kill AcroRd32.exe
printPdf.Close(); // Close the process and release resources
【问题讨论】:
-
看起来你不能:stackoverflow.com/search?q=command+line+adobe+acrobat+print,至少不能使用 Acrobat Reader。