This section describes how to use the XPS Document API to perform programming tasks.
For examples of how to use the XPS Document API in a program, see the XPS Document API Programming Tasks section.
For information about how to use the XPS Object Model and how it is implemented by the XPS Document API, see the Using the XPS Object Model section.
For complete programs, see the XPS Document API Programming Samples section.
Getting Started with the XPS Document API
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:
XPS Document API Programming Tasks
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
XpsFlowText demonstrates how to position a DirectWrite text layout on an XPS Canvas and then save it as an XPS document.
-
XpsLoadModifySave
XpsLoadModifySave demonstrates how to load an XPS document from a stream and how to modify and save the document.
-
XpsMailMerge
XpsMailMerge demonstrates how to use named fields in an XPS document to merge data into the document programmatically.
-
XpsOMPrint
XpsOMPrint demonstrates how to print an XPS OM by using the XPS Print API.
-
XpsOnePage
XpsOnePage demonstrates how to create an XPS document that contains only one blank page and write it to a file.
-
XpsRollup
XpsRollup demonstrates how to combine multiple XPS documents into a single document and rename the resource parts to prevent part name conflicts.
Related topics
- XPS Object Model Overview
- Using the XPS Object Model
- XPS Document API Programming Samples
- XPS Document API Reference
- XML Paper Specification
Send comments about this topic to Microsoft
Build date: 5/5/2012
