| layout | post |
|---|---|
| title | Print Events in Blazor PDF Viewer | Syncfusion |
| description | Learn how to configure print events and track usage and implements workflows in the Syncfusion Blazor PDF Viewer component. |
| platform | document-processing |
| control | |
| documentation | ug |
| domainurl |
This page lists each event emitted by the Blazor PDF Viewer's print feature, the argument schema, and the minimal behavior notes needed for implementation.
| Name | Description |
|---|---|
| PrintStart | Raised when a print action begins. Use the event to log activity or cancel printing. |
| PrintEnd | Raised after a print action completes. Use the event to notify users or clean up resources. |
The PrintStart event triggers when a print action begins.
See PrintStartEventArgs for details such as FileName and the Cancel option.
- If the Cancel property is set to
truein thePrintStartevent handler, the print operation is canceled and the print dialog does not open. - By default,
Cancelisfalse.
The following example illustrates how to handle the PrintStart event.
{% tabs %} {% highlight razor %} @using Syncfusion.Blazor.SfPdfViewer @code{ private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf"; public async Task PrintStart(PrintStartEventArgs args) { Console.WriteLine($"Printed File Name: {args.FileName}"); } } {% endhighlight %} {% endtabs %}
The PrintEnd event triggers when a print action completes.
See PrintEndEventArgs for details such as FileName.
The following example illustrates how to handle the PrintEnd event.
{% tabs %} {% highlight razor %} @using Syncfusion.Blazor.SfPdfViewer @code{ private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf"; public async Task PrintEnd(PrintEndEventArgs args) { Console.WriteLine($"Printed File Name: {args.FileName}"); } } {% endhighlight %} {% endtabs %}