在用户看不到的情况下打印 PDF

问题描述

我想在我的电脑上安装 AcroRd32.exe 和 FoxitReader.exe。
现在我希望 AcroRd32.exe 成为默认的 PDF 阅读器,而 FoxitReader.exe 仅用于自动打印。

不幸的是它不能正常工作。

案例 1: FoxitReader 被设置为默认值。
这有效,但 FoxitReader 设置为默认值。不想要!

ProcessStartInfo info = new ProcessStartInfo(@fullPath);
info.Verb = "PrintTo";
info.Arguments = "printer";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);

情况 2: Adob​​eReader 被设置为默认值,但 FillName 是专门分配给 Foxit 的。
错误消息: System.ComponentModel.Win32Exception:“没有应用程序与指定的文件相关联”。

ProcessStartInfo info = new ProcessStartInfo(@fullPath);
info.FileName = "FoxitReader.exe";
info.Verb = "PrintTo";
info.Arguments = "printer";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);

有谁知道我如何解决它或为什么会出现错误?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)