c# - 有没有办法确定 Microsoft XPS Document Writer 在系统上是否可用且功能正常

标签 c# .net xps

是否有可靠的方法来确定 Microsoft XPS Document Writer 是否可以通过 .Net 在系统上使用并正常运行?

此外,XPS Writer 的名称在所有 Windows 发行版上都相同吗(例如英语、德语 (...))?

自 Vista 以来,XPS Writer 确实可以在所有 Windows 系统上使用吗?也在 Starter Edition、所有 x86 和 x64 版本以及 Windows 8 上吗?

最佳答案

看看http://msdn.microsoft.com/en-us/library/aa969772.aspx

我怀疑您可以使用下面的代码片段来尝试打印 XPS,如果它不起作用,则您可能没有打印机。

            try
            {
                // Print the Xps file while providing XPS validation and progress notifications.
                PrintSystemJobInfo xpsPrintJob = defaultPrintQueue.AddJob(f.Name, nextFile, false);
            }
            catch (PrintJobException e)
            {
                Console.WriteLine("\n\t{0} could not be added to the print queue.", f.Name);
                if (e.InnerException.Message == "File contains corrupted data.")
                {
                    Console.WriteLine("\tIt is not a valid XPS file. Use the isXPS Conformance Tool to debug it.");
                }
                Console.WriteLine("\tContinuing with next XPS file.\n");
            }

关于c# - 有没有办法确定 Microsoft XPS Document Writer 在系统上是否可用且功能正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9735738/

相关文章:

c# - 如何使用钩子(Hook)的参数化方法 - SpecFlow

.net - 无窗口 .NET 应用程序中的全局热键

c# - 如何在 Windows 中使用 UniDrv 或 XPS 驱动程序 v3 设置虚拟打印机和显示器

c# - C++中字符串的L前缀

html - 媒体查询不适用于 Windows 服务器

Windows:如何告诉打印机在打印过程中发出 FormFeed?

c# - 如何创建 XPS 文档?

c# - 如何在 C# 中正确反序列化 JSON

c# - 在 .Net 中使用 IE 设置中的代理自动配置

c# - 如何在C#中声明sql变量