大网数据广告活动
打印与设备

XPS OM Print Ticket Interfaces

· 52CE 我爱测

This IXpsOMPrintTicketResource interface of the XPS Document API provides access to an existing print ticket and also the ability to create a print ticket in an XPS OM.

This IXpsOMPrintTicketResource interface of the XPS Document API provides access to an existing print ticket and also the ability to create a print ticket in an XPS OM.

Print Ticket Resources

The IXpsOMPrintTicketResource interface enables a program to read the contents of an existing print ticket by calling the GetPrintTicketResource method of an interface that supports a print ticket. New print ticket resources can be added to a document part by calling SetPrintTicketResource.

There are three print ticket levels, which specify the scope of the print ticket. The print ticket levels are: the job (or package) level, the document level, and the page level. The following table shows the relationship between the print ticket level, the corresponding XPS OM interface, and the methods used to access the print ticket resource.

Print Ticket Level Interface Get Method Set Method
Job IXpsOMDocumentSequence GetPrintTicketResource SetPrintTicketResource
Document IXpsOMDocument GetPrintTicketResource SetPrintTicketResource
Page IXpsOMPageReference GetPrintTicketResource SetPrintTicketResource

Print Ticket Content

The content of an existing print ticket resource can be accessed by reading from the stream associated with the resource. The GetStream method of the IXpsOMPrintTicketResource interface returns the pointer to a read-only stream that contains the XML-formatted contents of the print ticket. The format of the print ticket content is described in the Print Schema Specification.

A new print ticket resource can be created by creating a new IXpsOMPrintTicketResource interface. A valid, XML-formatted print ticket is written to a stream and a part URI is created to identify the print ticket part. For more information about the content of a valid print ticket, refer to the Print Schema Specification. The stream and the part URI are passed as parameters of the SetContent call to set the new print ticket resource and the print ticket resource is added to the corresponding document part by calling the SetPrintTicketResource method shown in the preceding table.

Print Ticket Inheritance

Print tickets inherit the properties of print tickets with greater scope. For example, a document-level print ticket inherits the properties of the job-level print ticket that is associated with the document's document sequence. Likewise, a page-level print ticket inherits the properties of the document-level print ticket that is associated with the page's document. In this inheritance process, properties that are specified in the lower-level print ticket override the corresponding properties that would otherwise be inherited from the higher-level print ticket.

Related topics

Print Schema Specification

IXpsOMDocument

IXpsOMDocumentSequence

IXpsOMPageReference

IXpsOMPrintTicketResource

XML Paper Specification

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。