HelpBot Assistant

How can I help you?

Suppress the error dialog in Blazor SfPdfViewer Component

1 Oct 20251 minute to read

The Syncfusion® Blazor SfPdfViewer component supports suppressing the built-in error dialog using the EnableErrorDialog property. When EnableErrorDialog is set to false, the error dialog is not displayed. The default value is true. Applications can handle errors through custom logic when the dialog is disabled.

The following code example shows how to suppress the error dialog.

@using Syncfusion.Blazor.SfPdfViewer

<SfPdfViewer2 @ref="PdfViewer"
              DocumentPath="@DocumentPath"
              EnableErrorDialog="false"
              Height="100%"
              Width="100%">
</SfPdfViewer2>

@code{
    SfPdfViewer2 PdfViewer;
    private string DocumentPath { get; set; } = "PDF_Succinctly.pdf";
}

View sample on GitHub