Occurs when a print task requests the document to print. The supplied print document must implement the IPrintDocumentSource interface.
Pointer to a PrintTaskSourceRequestedArgs object.
The PrintTaskSourceRequestedHandler is called to complete the initialization of a PrintTask object. This two-phase initialization model is designed to enable an app to quickly respond to the PrintTaskRequested event by creating the PrintTask object. Then later, when printing is actually invoked, PrintTaskSourceRequestedHandler does the work required to prepare the content to be previewed and eventually printed. The deadline for completing work in the PrintTaskSourceRequestedHandler is much larger than the deadline for completing work in the PrintTaskRequested handler.
For example, consider an app that needs to download information from the Cloud to complete the printing operation for the details of a boarding pass. The app should respond quickly to the PrintTaskRequested event by creating a PrintTask object and a name for the print operation, for example "Fabrikam Boarding Pass." The app then provides PrintTaskSourceRequestedHandler with a pointer the PrintTask object. When this handler is invoked the app then initiates the call to retrieve the actual content of the boarding pass so that print preview and printing can be performed.
An app has two options for creating a print document source object:
- Provide a custom print document source. An app may choose to provide its own custom implementation of an IPrintDocumentSource object. Doing so requires a good understanding of Direct2D and/or the XPS APIs. For an example of how an app can provide its own custom print document source, see the D2D Printing sample.
Minimum supported client
Minimum supported server
|Windows Server 2012|
Build date: 11/16/2013