Using XPS Document API
This section describes how to use the XPS Document API to perform programming tasks.
For complete programs, see the XPS Document API Programming Samples section.
Before you start using the XPS Document API, make sure that you are familiar with the following programming topics:
When using the XPS Document API, you might also want to use the following technologies:
The topics in this section describe how to use the XPS Document API in a program and demonstrate how to perform some common programming tasks.
The XPS Document API uses collections to work with groups of interfaces. Working with XPS OM Collection Interfaces describes how to program with these collections.
The Common XPS Document Programming Tasks include the following:
- Initialize an XPS OM
- Create a Blank XPS OM
- Read an XPS Document into an XPS OM
- Navigate the XPS OM
- Write Text to an XPS OM
- Draw Graphics in an XPS OM
- Place Images in an XPS OM
- Write an XPS OM to an XPS Document
- Print an XPS OM
The Advanced XPS Document Programming Tasks include the following:
The XPS Document API Programming Samples include the following:
XpsFlowText demonstrates how to position a DirectWrite text layout on an XPS Canvas and then save it as an XPS document.
XpsLoadModifySave demonstrates how to load an XPS document from a stream and how to modify and save the document.
XpsMailMerge demonstrates how to use named fields in an XPS document to merge data into the document programmatically.
XpsOMPrint demonstrates how to print an XPS OM by using the XPS Print API.
XpsOnePage demonstrates how to create an XPS document that contains only one blank page and write it to a file.
XpsRollup demonstrates how to combine multiple XPS documents into a single document and rename the resource parts to prevent part name conflicts.