HelpBot Assistant

How can I help you?

Check document editing status in Blazor SfPdfViewer Component

1 Oct 20251 minute to read

Use the IsDocumentEdited property to determine whether the loaded PDF has unsaved changes. A document is considered edited when users modify annotations, fill form fields, add or update signatures, apply redactions, or make other in-viewer changes. The property becomes true.

The following example shows how to check the document’s editing status.

@using Syncfusion.Blazor.SfPdfViewer
@using Syncfusion.Blazor.Buttons

<SfButton @onclick="OnClick">Check</SfButton>
<SfPdfViewer2 @ref="Viewer"
              DocumentPath="@DocumentPath"
              Height="100%"
              Width="100%">
</SfPdfViewer2>

@code{
    public SfPdfViewer Viewer { get; set; }
    private string DocumentPath { get; set; } = "Data/PDF_Succinctly.pdf";

    //Prints the document's edited status in console window.
    public void OnClick(MouseEventArgs args)
    {
        Console.WriteLine(Viewer.IsDocumentEdited);
    }
}

View sample on GitHub.