Skip to main content
PrintTaskRequest class

Contains the request from the system to create a print task. This object is available from the PrintTaskRequestedEventArgs object passed to the PrintTaskRequested event.


/* For information about creating or accessing this object, see Remarks. */

public sealed class PrintTaskRequest

Public NotInheritable Class PrintTaskRequest

public ref class PrintTaskRequest sealed 


The PrintTaskRequest class has these types of members:


The PrintTaskRequest class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

CreatePrintTask Creates a new PrintTask which indicates that the app has content to be printed.
GetDeferral Retrieves the deferral object associated with the PrintTaskRequest.



The PrintTaskRequest class has these properties.

PropertyAccess typeDescription



Gets a DateTime value that indicates how long an app has to respond to the PrintTaskRequested event.



The PrintTaskRequest class is used by an app to create a new PrintTask object. A PrintTask object is created in response to the PrintTaskRequested event and it indicates to the system that the app has content to be printed. When creating a PrintTask object using the CreatePrintTask method, the app must provide a name for the PrintTask and a PrintTaskSourceRequestedHandler event handler which is called when the content to be printed is required.

An app should do the minimum amount of work possible in the PrintTaskRequested event handler since only a short amount of time is provided for a response. Wherever possible, the app should simply create a PrintTask and delay any content initialization until the PrintTaskSourceRequestedHandler event handler is called.

If an app needs to perform an asynchronous operation during the PrintTaskRequested handler it must retrieve and use a PrintTaskRequestedDeferral object. Prior to the exit of the event handler, and typically before the asynchronous operation is started, the app must retrieve the PrintTaskRequestedDeferral object by calling the GetDeferral method of the PrintTaskRequest object. When the asynchronous operation completes, the app must call the Complete method of the PrintTaskRequestedDeferral object to signal that the print task request is complete. The call to the Complete method must occur before the Deadline is reached in order for the request to be accepted.

The CreatePrintTask method in PrintTaskRequest can be used to create the print task. Here is a JavaScript code snippet to show how you would create a print task:

    // Print event handler for printing via the PrintManager API.
    // printEvent contains the print task request object
    function onPrintTaskRequested(printEvent) {
        printEvent.request.createPrintTask("Print Sample", function (args) {

To see the complete listing for this, and other printing scenarios using CreatePrintTask, see Printing.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Graphics::Printing [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported


Windows::Graphics::Printing [C++]




[ MarshalingBehavior(Agile)]
[ Muse()]
[ Version(0x06020000)]

See also