IXpsOMDocument::GetPageReferences method (xpsobjectmodel.h)

Gets the IXpsOMPageReferenceCollection interface of the document, which allows virtualized access to its pages.

Syntax

HRESULT GetPageReferences(
  [out, retval] IXpsOMPageReferenceCollection **pageReferences
);

Parameters

[out, retval] pageReferences

A pointer to the IXpsOMPageReferenceCollection interface that contains a collection of page references for each page of the document. If there are no page references, the IXpsOMPageReferenceCollection returned in pageReferences will be empty and will have no elements.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the table that follows. For information about XPS document API return values that are not listed in this table, see XPS Document Errors.

Return code Description
S_OK
The method succeeded.
E_POINTER
pageReferences is NULL.

Remarks

To get the pages of a document, first get the list of IXpsOMPageReference interfaces by calling GetPageReferences. Then, for each IXpsOMPageReference interface, load a page by calling GetPage.

If the document does not have any pages, the page reference collection returned in pageReferences will be empty. To get the number of page references in the collection, call its GetCount method.

For an example of how this method can be used in a program, see Navigate the XPS OM.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h

See also

IXpsOMDocument

IXpsOMPageReference

IXpsOMPageReferenceCollection

Navigate the XPS OM

XML Paper Specification

XPS Document Errors