XpsDocument GetFixedDocumentSequence对于由特定计算机生成的文件返回null [英] XpsDocument GetFixedDocumentSequence return null for files generated by a specific computer

查看:122
本文介绍了XpsDocument GetFixedDocumentSequence对于由特定计算机生成的文件返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Solidworks生成"EDRWX"文件.通常,这些文件是用Microsoft XPS查看器打开的.

Solidworks generate "EDRWX" files. Usually, those are opened with Microsoft XPS viewer.

问题:
应用程序使用.net XPSDocument打开它们并在打印之前对其进行一些操作.故障方法是"GetFixedDocumentSequence".对于从特定计算机生成的文件,它返回null.即使应用程序在特定计算机上运行,​​它也会这样做.但是,它可以与其他计算机生成的文件一起正常工作.

Issue :
An application use .net XPSDocument to open them and do some manipulation with them before printing. The faulting method is "GetFixedDocumentSequence". It returns null with files generate from a specific computer. It does so even when the application is running on the specific computer. But it is working fine with file generated by other computer.

当尝试使用XPS文档查看器打开文件时,由于无法打开而无法打开.但是,它确实在创建它的特定计算机上打开.如果此计算机从Microsoft Word打印正常的XPS文件,则其他计算机都可以使用XPS文档查看器正常打开它.另外,其他计算机生成的"EDRWX"文件可以在包括特定计算机在内的每台计算机上使用XPS文档查看器轻松打开.

When trying to open the file with XPS document viewer, it's fail to open saying it can't be opened. However, it does open on the specific computer that created it. If this computer print a normal XPS file from microsoft word, others computer are able to open it normally with XPS document viewer. Also, "EDRWX" file generated by others computers are easily opened with XPS document viewer on every computer including the specific one.

更多规范:
特定计算机在Windows 8.1下运行.
其他计算机在Windows 7下运行.
该应用程序在.net Framework 4.0上运行.

More specification :
The specific computer run under windows 8.1.
Others computers run under windows 7.
The application run with .net Framework 4.0.

此处是由特定计算机生成的"EDRWX"伪文件.
此处是由其他计算机之一生成的"EDRWX"虚拟文件.

Here is a "EDRWX" dummy file generated by the specific computer.
Here is a "EDRWX" dummy file generated by one of the others computers.

问题的原因是什么,如何解决?

What is the cause of the issue and how can it be fixed?

旁注:我已经调查了将近3天....所以我对此问题感到生气.也许你的眼睛可以看到我不再那么被它吸引了.

Sidenote : I have been investigating for almost 3 days....So I'm getting angry at the problem. May be your eyes can see what I don't anymore for being sucked into it this much.

在挖掘过程中,我发现了这两个文件之间的区别.

In my digging, I found this difference between the two files.

推荐答案

失败的EDRWX文件不是XPS文件,它们是Open XPS文件.两种格式非常相似,但是,正如您所发现的,XPSDocument不支持OpenXPS.我不知道任何直接支持Open XPS的.net API,但是Microsoft确实发布了独立转换器工具,您也许可以利用.

The failing EDRWX files are not XPS files, they are Open XPS files. The two formats are very similar, however as you have discovered, XPSDocument doesn't support OpenXPS. I am not aware of any .net API that directly supports Open XPS, however microsoft did release standalone converter tools that you may be able to leverage.

另一种可能有效或无效的替代方法是尝试迫使SolidWorks在出现故障的机器上生成xps而不是oxps. solidworks可能使用xps文档编写器来生成这些文件,在这种情况下,如此处可以解决该问题.

Another alternative, which may or may not work, is to try to force SolidWorks to generate xps instead of oxps on the failing machine. It is possible that solidworks is using the xps document writer to generate these files, in which case changing the output format as described here may resolve the issue.

这篇关于XpsDocument GetFixedDocumentSequence对于由特定计算机生成的文件返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆