Using XPS Document API

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 About XPS Document API.

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:

COM Programming
Error Handling in COM

When using the XPS Document API, you might also want to use the following technologies:

DirectWrite
XPS Print API
XPS Digital Signature API

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:

Merge XPS Documents
Processing XPS Documents in an XPSDrv Filter

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 Document API Programming Samples
XPS Document API Reference
XML Paper Specification

 

 

Community Additions

ADD
Show:
© 2014 Microsoft