IXpsOMPage::Write method (xpsobjectmodel.h)

Writes the page to the specified stream.

Syntax

HRESULT Write(
  [in] ISequentialStream *stream,
  [in] BOOL              optimizeMarkupSize
);

Parameters

[in] stream

The stream that receives the serialized contents of the page.

[in] optimizeMarkupSize

A Boolean value that indicates whether the document markup of the page is to be optimized for size when the page is written to the stream.

Value Meaning
TRUE
The package writer will attempt to optimize the markup for minimum size when writing the page to the stream.
FALSE
The package writer will not attempt any optimization when writing the page to the stream.

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
stream is NULL.

Remarks

To examine the XPS markup of a page before it is written to an XPS package, an application can call the Write method to write the page's contents to a stream. The application can then read that stream to examine the XPS markup as it would be serialized when it is written to the XPS package.

The XPS markup that is written to the stream by this method contains the page markup but none of the page's resources.

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

ISequentialStream

IXpsOMPage

XML Paper Specification

XPS Document Errors