IXpsOMObjectFactory::CreatePackageWriterOnStream method (xpsobjectmodel.h)
Opens a stream for writing the contents of an XPS OM to an XPS package.
HRESULT CreatePackageWriterOnStream( [in] ISequentialStream *outputStream, [in] BOOL optimizeMarkupSize, [in] XPS_INTERLEAVING interleaving, [in] IOpcPartUri *documentSequencePartName, [in] IXpsOMCoreProperties *coreProperties, [in] IXpsOMImageResource *packageThumbnail, [in] IXpsOMPrintTicketResource *documentSequencePrintTicket, [in] IOpcPartUri *discardControlPartName, [out, retval] IXpsOMPackageWriter **packageWriter );
The stream to be used for writing.
A Boolean value that indicates whether the document markup will be optimized for size when the document is written to the stream.
||When writing to the stream, the package writer will attempt to optimize the markup for minimum size.|
||When writing to the package, the package writer will not attempt any optimization.|
Specifies whether the content of the XPS OM will be interleaved when it is written to the stream.
The IOpcPartUri interface that contains the part name of the document sequence in the new file.
The IXpsOMCoreProperties interface that contains the core document properties to be given to the new file. This parameter can be set to NULL.
The IXpsOMImageResource interface that contains the thumbnail image to be assigned to the new file. This parameter can be set to NULL.
The IXpsOMPrintTicketResource interface that contains the package-level print ticket to be assigned to the new file. This parameter can be set to NULL.
The IOpcPartUri interface that contains the name of the discard control part. This parameter can be set to NULL.
[out, retval] packageWriter
A pointer to the new IXpsOMPackageWriter interface created by this method.
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.
||The method succeeded.|
||outputStream, documentSequencePartName, or packageWriter is NULL.|
||coreProperties, documentSequencePrintTicket or packageThumbnail does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.|
The stream is opened and initialized, and then the returned IXpsOMPackageWriter interface is used to write content types, package relationships, core properties, document sequence resources, and document sequence relationships.
If documentSequencePrintTicket is set to NULL and the value of interleaving is XPS_INTERLEAVING_ON, this method creates a blank job-level print ticket and adds a relationship to the blank print ticket. This is done to provide more efficient streaming consumption of the package.
If documentSequencePrintTicket is set to NULL and the value of interleaving is XPS_INTERLEAVING_OFF, no blank print ticket is created.
|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]|