IXpsOMPackageTarget::CreateXpsOMPackageWriter method (xpsobjectmodel.h)

Create an IXpsOMPackageWriter interface for use with a print job that the StartXpsPrintJob1 function created.

Syntax

HRESULT CreateXpsOMPackageWriter(
  [in]           IOpcPartUri               *documentSequencePartName,
  [in, optional] IXpsOMPrintTicketResource *documentSequencePrintTicket,
  [in, optional] IOpcPartUri               *discardControlPartName,
  [out, retval]  IXpsOMPackageWriter       **packageWriter
);

Parameters

[in] documentSequencePartName

The IOpcPartUri interface that contains the part name of the document sequence in the new file.

[in, optional] documentSequencePrintTicket

The IXpsOMPrintTicketResource interface that contains the package-level print ticket to be assigned to the new file. Set this parameter to NULL if you do not have a package-level print ticket.

[in, optional] discardControlPartName

The IOpcPartUri interface that contains the name of the discard control part. Set this parameter to NULL if you do not have a discard control part.

[out, retval] packageWriter

A pointer to the new IXpsOMPackageWriter interface that this method created.

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
packageWriter is NULL.
XPS_E_NO_CUSTOM_OBJECTS
documentSequencePrintTicket 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.

Requirements

Requirement Value
Minimum supported client Windows 7 with SP1, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 with SP1, Windows Server 2008 and Platform Update Supplement for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h
Library XpsPrint.lib

See also

IXpsOMPackageTarget

StartXpsPrintJob1

XML Paper Specification