Microsoft Docs

Documentation for Windows Developers

XPS (XML Paper Specification) API Reference

The XPS Document API enables applications to create, manipulate, and render XPS documents programmatically. This section provides reference documentation for the interfaces, structures, and functions related to XPS document handling in Windows.

Core Concepts

The XPS Document API provides a comprehensive set of tools for working with XPS files, including:

Key Interfaces

IXPSDocumentConsumer

Represents a consumer of XPS document content, allowing data to be written to an XPS document.

HRESULT IXPSDocumentConsumer::SendXpsDocumentPackageStream( IXpsDocumentPackageStream *xpsDocumentPackageStream );

Parameters:

xpsDocumentPackageStream
A pointer to an IXpsDocumentPackageStream interface that provides the XPS document content.

IXPSDocumentWriter

Provides methods for writing content to an XPS document package.

HRESULT IXPSDocumentWriter::AddDocumentSequence( IXpsDocumentSequence **documentSequence ); HRESULT IXPSDocumentWriter::AddFixedDocument( IXpsFixedDocument **fixedDocument ); HRESULT IXPSDocumentWriter::AddFixedPage( IXpsFixedPage **fixedPage );

Methods:

AddDocumentSequence
Adds a new document sequence to the XPS document.
AddFixedDocument
Adds a new fixed document to the XPS document.
AddFixedPage
Adds a new fixed page to the XPS document.

IXpsOMPackageWriter

An interface for writing XPS Object Model (XPS OM) packages.

HRESULT IXpsOMPackageWriter::WritePackage( IStream *outputStream, BOOL32 closeStream = TRUE );

Parameters:

outputStream
A pointer to the output stream where the XPS package will be written.
closeStream
A boolean value that indicates whether the stream should be closed after writing.

Related Topics

Last updated: July 25, 2023