XpsDocument GetFixedDocumentSequence对于由特定计算机生成的文件返回null

编程入门 行业动态 更新时间:2024-10-24 15:15:47
本文介绍了XpsDocument GetFixedDocumentSequence对于由特定计算机生成的文件返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

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

Issue : An application use 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下运行. 该应用程序在 Framework 4.0上运行.

More specification : The specific computer run under windows 8.1. Others computers run under windows 7. The application run with 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的 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 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

本文发布于:2023-11-11 10:29:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578169.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   计算机   XpsDocument   GetFixedDocumentSequence   null

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!