IXpsOMObjectFactory1::CreatePage1 method (xpsobjectmodel_1.h)

Creates an IXpsOMPage interface, which provides the root node of a tree of objects that represent the contents of a single page.

Syntax

HRESULT CreatePage1(
  const XPS_SIZE *pageDimensions,
  LPCWSTR        language,
  IOpcPartUri    *partUri,
  IXpsOMPage1    **page
);

Parameters

pageDimensions

The XPS_SIZE structure that specifies the size of the page to be created.

Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are 816 by 1,056 XPS units.

language

The string that indicates the default language of the created page.

[!ALERT] Important  The language string must follow the RFC 3066 syntax.

partUri

The IOpcPartUri interface that contains the part name to be assigned to this resource.

page

A pointer to the new IXpsOMPage interface.

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 pageDimensions, partUri, or page is NULL.
XPS_E_INVALID_LANGUAGE language does not contain a valid language string.
XPS_E_INVALID_PAGE_SIZE pageDimensions contains an invalid page size or invalid page size values.

Requirements

Requirement Value
Header xpsobjectmodel_1.h

See also

IXpsOMObjectFactory1

The Internet Engineering Task Force (IETF) RFC 3066

XML Paper Specification

XML Paper Specification