# pdf-viewer-detect-pdf-changes

> PDF viewer detects any modifications and changes that occur in the loaded PDF document.

**Framework:** maui  **Component:** PdfViewer  **Variant:** detect-pdf-changes

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/maui/pdf-viewer-detect-pdf-changes.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Maui.PdfViewer
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/pdf-viewer-detect-pdf-changes/PdfViewer.xaml

```xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:pdf="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer"
             xmlns:model="clr-namespace:MAUI.Controls.PdfViewer.DetectPDFChanges"
             x:Class="MAUI.Controls.PdfViewer.DetectPDFChanges.PdfViewerView"
             x:DataType="model:PdfViewerViewModel"
             Title="PDF Viewer - Detect PDF Changes">
    <ContentPage.Content>
        <syncfusion:SfPdfViewer x:Name="PdfViewer"
                                DocumentSource="{Binding DocumentStream}"
                                FormFieldValueChanged="PdfViewer_FormFieldValueChanged"
                                AnnotationAdded="PdfViewer_AnnotationAdded"
                                AnnotationEdited="PdfViewer_AnnotationEdited"
                                AnnotationRemoved="PdfViewer_AnnotationRemoved"/>
    </ContentPage.Content>
</ContentPage>

```

### src/components/pdf-viewer-detect-pdf-changes/PdfViewer.xaml.cs

```cs
namespace MAUI.Controls.PdfViewer.DetectPDFChanges
{
    public partial class PdfViewerView : ContentPage
    {
        TextSearchResult? SearchResult;
        public PdfViewerView(PdfViewerViewModel viewModel)
        {
            InitializeComponent();
            BindingContext = viewModel;

        }
        private async void PdfViewer_FormFieldValueChanged(object sender, FormFieldValueChangedEventArgs e)
        {
            var page = Application.Current?.Windows?.FirstOrDefault()?.Page;
            if (page is null)
                return;

            await page.DisplayAlertAsync("PDF Edited", $"{e.FormField} value is changed.", "OK");
        }

        private async void PdfViewer_AnnotationAdded(object sender, AnnotationEventArgs e)
        {
            var page = Application.Current?.Windows?.FirstOrDefault()?.Page;
            if (page is null)
                return;
            await page.DisplayAlertAsync("PDF Edited", "Annotation is added.", "OK");
        }

        private async void PdfViewer_AnnotationEdited(object sender, AnnotationEventArgs e)
        {
            var page = Application.Current?.Windows?.FirstOrDefault()?.Page;
            if (page is null)
                return;
            await page.DisplayAlertAsync("PDF Edited", $"Annotation is edited.", "OK");
        }

        private async void PdfViewer_AnnotationRemoved(object sender, AnnotationEventArgs e)
        {
            var page = Application.Current?.Windows?.FirstOrDefault()?.Page;
            if (page is null)
                return;
            await page.DisplayAlertAsync("PDF Edited", $"Annotation is removed.", "OK");
        }
    }
}

```
