Skip to main content
PrintManager.PrintTaskRequested | printtaskrequested event

Applies to Windows only

Raised when a request to print has occurred. This event may be triggered by user action or via programmatic invocation of printing via the ShowPrintUIAsync method.

Syntax


function onPrintTaskRequested(eventArgs) { /* Your code */ }
 
// addEventListener syntax
printManager.addEventListener("printtaskrequested", onPrintTaskRequested);
printManager.removeEventListener("printtaskrequested", onPrintTaskRequested);
 
- or -

printManager.onprinttaskrequested = onPrintTaskRequested;

public event TypedEventHandler<PrintManager, PrintTaskRequestedEventArgs> PrintTaskRequested

Public Event PrintTaskRequested As TypedEventHandler(Of PrintManager, PrintTaskRequestedEventArgs)

public:
event TypedEventHandler<PrintManager, PrintTaskRequestedEventArgs>^ PrintTaskRequested {
   Windows::Foundation::EventRegistrationToken add(TypedEventHandler<PrintManager, PrintTaskRequestedEventArgs>^ value);
   void remove(Windows::Foundation::EventRegistrationToken token);
}

Event information

Delegate TypedEventHandler<PrintManager, PrintTaskRequestedEventArgs>

Remarks

When you add print capabilities to your Windows Store app, you have to implement an event handler to process this event when it is raised. Here is a JavaScript code snippet that shows how to handle this event:


// Print event handler for printing via the PrintManager API.
// printEvent contains the print task request object
    function onPrintTaskRequested(printEvent) {    
        var printTask = printEvent.request.createPrintTask("Print Sample", function (args) {
            args.setSource(MSApp.getHtmlPrintDocumentSource(document));
    });

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

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

See also

Printing
PrintManager