Freigeben über


IXpsOMObjectFactory::CreatePageFromStream method

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

  • pageMarkupStream [in]
    The stream that contains the page markup.

  • partUri [in]
    The IOpcPartUri interface that contains the page's URI.

  • resources [in]
    The IXpsOMPartResources interface that contains the resources used by the page.

  • reuseObjects [in]
    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.

     

  • page [out, retval]
    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

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Header

Xpsobjectmodel.h

IDL

XpsObjectModel.idl

See also

IXpsOMObjectFactory

IOpcPartUri

IXpsOMPage

IXpsOMPartResources

Packaging Errors

XPS Document Errors

XML Paper Specification