IXpsOMPageReference::SetPage method (xpsobjectmodel.h)

Sets the IXpsOMPage interface of the page reference.

Syntax

HRESULT SetPage(
  [in] IXpsOMPage *page
);

Parameters

[in] page

The IXpsOMPage interface pointer of the page.

Return value

If the method succeeds, it returns S_OK; otherwise, it returns an HRESULT error code.

Return code Description
S_OK
The method succeeded.
E_POINTER
page is NULL.
XPS_E_NO_CUSTOM_OBJECTS
page does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.

Remarks

The page added by this method can be empty or fully constructed.

If the incoming page has references to remote dictionary objects, those objects will not be imported into the document object by this call. They must be added in a separate call to the IXpsOMPage::SetDictionaryResource or IXpsOMCanvas::SetDictionaryResource method.

If a page has been set, the calling method must first release that page before calling SetPage with a new page. To explain, once SetPage has been called with a new page, the original page cannot be discarded even if it still exists in the package.

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

IXpsOMPage

IXpsOMPageReference

IXpsOMPageReference::DiscardPage

IXpsOMPageReference::GetPage

XML Paper Specification