【发布时间】:2018-11-01 16:46:13
【问题描述】:
我正在尝试制作一个将 pdf 文件发送到热敏打印机的程序。问题是文件发送到打印机后,默认的 PDF 阅读器(本例中为 foxit 阅读器)总是打开且无法管理。是的,我已经花了几天时间搜索,但没有什么对我完全有效。
另外,我曾尝试关闭 Foxit Reader PDF 打印机上的“查看 PDF 结果”属性,但似乎效果不佳。
这是我的简单代码:
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(@"D:\test.pdf");
info.Arguments = "\"XP-58\"";
info.CreateNoWindow = true;
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
info.UseShellExecute = true;
info.Verb = "PrintTo";
PrintProcess p = new PrintProcess();
p.StartInfo = info;
p.EnableRaisingEvents = true;
p.Start();
p.WaitForInputIdle(1500);
p.Stop();
【问题讨论】: