MXDW 配置设置

借助 Microsoft XPS 文档编写器 (MXDW),用户能够通过从任何 Windows 应用程序打印来创建 XPS 文档文件。 应用程序开发人员可以使用打印架构的 PrintTicket 和 PrintCapabilities 部件控制 MXDW 的以下输出设置。

JobInterleaving

JobInterleaving 设置可控制 XPS 文档的内容交错顺序。 有关作业交错的信息,请参阅 XML 纸张规范。 MXDW 支持此设置的以下两个选项:

  • - 此选项会禁用交错,以便文档中每个内容元素的所有数据是连续的,从而提高随机访问的效率。 此选项最适合查看 XPS 文档。
  • - 此选项会启用交错,以便分解每个内容元素的数据并重新排序,从而更高效地进行顺序处理。 此选项最适合用于 Web 下载和打印。

以下示例是包含 JobInterleaving 设置的 PrintCapabilities XML 的示例。

<psf:Feature name="ns0000:JobInterleaving">
   <psf:Property name="psf:SelectionType">
      <psf:Value xsi:type="xsd:QName">psk:PickOne</psf:Value> 
   </psf:Property>
   <psf:Property name="psk:DisplayName">
      <psf:Value xsi:type="xsd:string">Interleaving</psf:Value> 
   </psf:Property>
   <psf:Option name="ns0000:OFF" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
         <psf:Value xsi:type="xsd:string">Off - Best for viewing</psf:Value> 
      </psf:Property>
   </psf:Option>
   <psf:Option name="ns0000:ON" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
         <psf:Value xsi:type="xsd:string">On - Best for the web/printing</psf:Value> 
      </psf:Property>
   </psf:Option>
</psf:Feature>

PrintTicket XML 与之类似,只不过它指定了一个特定选项。 有关详细信息,请参阅打印架构

由于 JobInterleaving 不是打印架构公共关键字之一,因此必须在 PrintCapabilities(或 PrintTicket)文档开头的 PrintCapabilities(或 PrintTicket)标签中包括命名空间的声明(本例中为“ns0000”),如下示例所示

<psf:PrintCapabilities 
xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" 
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema"  
version="1" 
xmlns:ns0000=http://schemas.microsoft.com/windows/2006/06/printing/printschemakeywords/microsoftxpsdocumentwriter>

JobImageType

JobImageType 可控制嵌入位图格式的输出格式。 MXDW 支持此设置的以下四个选项:

  • JPEGHigh - 此选项可指定具有较高压缩级别的 JPEG 图像。 此选项会生成最小的文件大小,但图像质量最低。
  • JPEGMed - 此选项指定具有中等压缩级别的 JPEG 图像。 此选项提供文件大小和图像质量的最佳平衡。
  • JPEGLow - 此选项指定压缩级别较低的 JPEG 图像。 此选项产生最小的文件大小减小和高图像质量。
  • PNG - 此选项指定具有无损压缩的 PNG 图像格式。 此选项会生成最大的文件大小和最高的图像质量。

JobImageType 设置的 PrintCapabilities XML 外观如下所示:

<psf:Feature name="ns0000:JobImageType">
   <psf:Property name="psf:SelectionType">
      <psf:Value xsi:type="xsd:QName">psk:PickOne</psf:Value> 
   </psf:Property>
   <psf:Property name="psk:DisplayName">
      <psf:Value xsi:type="xsd:string">Images</psf:Value> 
   </psf:Property>
   <psf:Option name="ns0000:JPEGHigh" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
         <psf:Value xsi:type="xsd:string">JPG - Maximum compression</psf:Value> 
      </psf:Property>
   </psf:Option>
   <psf:Option name="ns0000:JPEGMed" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
        <psf:Value xsi:type="xsd:string">JPG - Medium compression</psf:Value> 
      </psf:Property>
   </psf:Option>
   <psf:Option name="ns0000:JPEGLow" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
         <psf:Value xsi:type="xsd:string">JPG - Minimum compression</psf:Value> 
      </psf:Property>
   </psf:Option>
   <psf:Option name="ns0000:PNG" constrained="psk:None">
      <psf:Property name="psk:DisplayName">
         <psf:Value xsi:type="xsd:string">PNG - Lossless compression</psf:Value> 
      </psf:Property>
   </psf:Option>
</psf:Feature>

PrintTicket XML 与之类似,只不过它指定了一个特定选项。 有关详细信息,请参阅打印架构

由于 JobImagetype 不是打印架构公共关键字之一,因此必须在 PrintCapabilities(或 PrintTicket)文档开头的 PrintCapabilities(或 PrintTicket)标签中包括命名空间的声明(本例中为“ns0000”),如下示例所示

<psf:PrintTicket 
xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" 
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema"  
version="1" 
xmlns:ns0000=http://schemas.microsoft.com/windows/2006/06/printing/printschemakeywords/microsoftxpsdocumentwriter>

XML 纸张规范

打印架构规范

打印架构

XPS 规范和许可证下载