New to Telerik UI for Blazor? Download Free 30-day trial

PDF Viewer - Events

CONSOLE Clear log
  • Events.razor
  • PdfViewerConstants.cs
Loading the demo source code...please wait.


The Telerik UI for Blazor PDF Viewer component exposes several events that allow additional customization of the built-in behavior:

  • The OnOpen event is triggered when the end user selects a file to that they want to open. The event allows you to check what PDF file will be loaded in the Blazor PDF Viewer and decide whether to load it or reject it. This is useful for scenarios when the selected file should not be loaded for some reason (e.g. it contains inappropriate information, it is not signed, etc.).
  • The OnDownload event is triggered when the Download button from the toolbar of the PDF Viewer is clicked. The event provides a way for you to customize the name of the downloaded file.
  • The OnError event is triggered when a file error happens. Reasons for such errors might be that file is corrupted in some way or its format is incorrect. You can add a customized handling depending on the type of error, e.g. you can display an information dialog to the end user and ask them to load another file, load a default file instead, etc.
This PDF Viewer Events example is part of a unique collection of hundreds of Blazor demos, with which you can see all Telerik UI for Blazor components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for Blazor or ThemeBuilder.

Support & Learning Resources

An error has occurred. This application may no longer respond until reloaded.