Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 3.5 KB

File metadata and controls

83 lines (63 loc) · 3.5 KB
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 Print
documentation ug
domainurl

Print events in Blazor PDF Viewer

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.

Events

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.

PrintStart Event

The PrintStart event triggers when a print action begins.

Event arguments

See PrintStartEventArgs for details such as FileName and the Cancel option.

  • If the Cancel property is set to true in the PrintStart event handler, the print operation is canceled and the print dialog does not open.
  • By default, Cancel is false.

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 %}

PrintEnd Event

The PrintEnd event triggers when a print action completes.

Event arguments

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 %}

View Sample in GitHub

See also