IXpsOMObjectFactory::CreatePageFromStream method (xpsobjectmodel.h)

Reads the page markup from the specified stream to create and populate an IXpsOMPage interface.

Syntax

HRESULT CreatePageFromStream(
  [in]          IStream             *pageMarkupStream,
  [in]          IOpcPartUri         *partUri,
  [in]          IXpsOMPartResources *resources,
  [in]          BOOL                reuseObjects,
  [out, retval] IXpsOMPage          **page
);

Parameters

[in] pageMarkupStream

The stream that contains the page markup.

[in] partUri

The IOpcPartUri interface that contains the page's URI.

[in] resources

The IXpsOMPartResources interface that contains the resources used by the page.

[in] reuseObjects

A Boolean value that specifies whether the software is to attempt to optimize the page contents tree by sharing objects that are identical in all properties and children.

Value Meaning
TRUE
The software will attempt to optimize the object tree.
FALSE
The software will not attempt to optimize the object tree.

[out, retval] page

A pointer to the new IXpsOMPage interface created by this method.

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
pageMarkupStream, partUri, resources, or page is NULL.
XPS_E_NO_CUSTOM_OBJECTS
resources does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.
 

This method calls the Packaging API. For information about the Packaging API return values, see Packaging Errors.

Remarks

This method does not validate the contents of any stream-based resources that it loads from the stream into the document objects. The application must verify these resources before it uses them.

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

IOpcPartUri

IXpsOMObjectFactory

IXpsOMPage

IXpsOMPartResources

Packaging Errors

XML Paper Specification

XPS Document Errors