是否有可靠的方法来确定 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/