HRESULT PTConvertDevModeToPrintTicket( HPTPROVIDER hProvider, ULONG cbDevmode, PDEVMODE pDevmode, EPrintTicketScope scope, IStream *pPrintTicket );
The size of the DEVMODE in bytes.
A pointer to the DEVMODE.
A value that specifies the scope of pPrintTicket. This value can specify a single page, an entire document, or all documents in the print job. Settings in pDevmode that are outside the specified scope will not be included in pPrintTicket. See Remarks.
A pointer to an IStream with its seek position at the beginning of the print ticket.
If the operation succeeds, the return value is S_OK, otherwise the HRESULT contains an error code.
If hProvider was opened in a different thread, the HRESULT is E_INVALIDARG.
For more information about COM error codes, see Error Handling.
If the pDevmode points to a different printer, its settings may be lost and replaced with defaults.
Settings in pDevmode that are outside the scope are not included in pPrintTicket. For example, if the scope is a single page, then job-wide settings and document-wide settings are not included. A job scope includes document scope and page scope. A document scope includes page scope.
PTConvertDevModeToPrintTicket writes the print ticket to the IStream referenced by pPrintTicket starting at the stream's current seek point. After PTConvertDevModeToPrintTicket returns, the caller must reset the seek point to the initial seek point to read the print ticket returned by the function.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|