如何验证 XPS 文档?

发布于 2024-09-25 02:22:11 字数 55 浏览 7 评论 0原文

是否有任何 C# API 可以验证生成的 XPS 文档? (即确保该文件是有效的 xps 文件)

Is there any C# API to validate a generated XPS document?
(i.e. to make sure the file is a valid xps file)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北方。的韩爷 2024-10-02 02:22:11

不知道 API,但有一个 Microsoft 工具可以测试文件是否符合 XML Paper 规范:

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

干杯!

Don't know about an API, but there is a Microsoft tool that tests a file's conformity to the XML Paper Specification:

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

Cheers!

∞琼窗梦回ˉ 2024-10-02 02:22:11

XPs只是一种XML格式。

您可以尝试:

  1. 将 XPS 文件重命名为 *.zip,然后
    解压它。您将看到所有 xml。
    有相当多的文件和
    目录。
  2. 从以下位置下载 xps 的 XML 纸张规范
    http://www.microsoft.com/whdc/device/print/xps /xpsspec.mspx

  3. 所以现在你有了
    XPS 规范、模式(有五个)、
    和一大堆 xml 文档
    来验证。

当然,一旦您弄清楚哪个模式对应于哪个 xml 文件,就有很多简单的方法可以在 C# 中验证 xml。

祝你好运。

Xps just an XML format.

You could try:

  1. Rename the XPS file to *.zip, and
    unzip it. You will see all the xml.
    There are quite a few files and
    directories.
  2. Download the XML Paper Specification for xps from
    http://www.microsoft.com/whdc/device/print/xps/xpsspec.mspx.

  3. So now you have the
    spec for xps, the schemas (there are five),
    and a whole bunch of xml documents
    to validate.

There are of course plenty of easy ways to validate xml in C# once you figure out which schema corresponds to which xml file.

Good luck with that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文