Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IXpsOMPackage::WriteToStream method

Writes the XPS package to a specified stream.

Syntax


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

Parameters

stream [in]

The stream that receives the serialized contents of the package. This parameter must not be NULL.

optimizeMarkupSize [in]

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

ValueMeaning
TRUE

The package writer will attempt to optimize the markup for minimum size.

FALSE

The package writer will not attempt any optimization.

 

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 codeDescription
S_OK

The method succeeded.

E_POINTER

stream is NULL.

 

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

Remarks

The optimizeMarkupSize value determines whether the markup inside the individual document parts is to be optimized. It has no effect on how the parts are interleaved.

Note  Writing an XPS OM to a stream does not automatically create a thumbnail for the XPS document. To create a thumbnail of the XPS document, use the IXpsOMThumbnailGenerator interface.

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

IXpsOMPackage
ISequentialStream
Packaging Errors
XPS Document Errors
XML Paper Specification

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.