From 8d3f4a5425f7e57ae2756fe82932a00f1f7118cd Mon Sep 17 00:00:00 2001 From: Yaminisrisf4389 Date: Fri, 11 Apr 2025 13:05:45 +0530 Subject: [PATCH] 905508_hotfix --- wpf-toc.html | 1 + .../Check-the-loaded-document-is-edited.md | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 wpf/Pdf-Viewer/How-To/Check-the-loaded-document-is-edited.md diff --git a/wpf-toc.html b/wpf-toc.html index 1a903b566..259297b4f 100644 --- a/wpf-toc.html +++ b/wpf-toc.html @@ -1554,6 +1554,7 @@
  • Enable and Disable Notification bar
  • Disable the Undo Redo operation
  • Unload the document
  • +
  • Check the loaded document is edited
  • diff --git a/wpf/Pdf-Viewer/How-To/Check-the-loaded-document-is-edited.md b/wpf/Pdf-Viewer/How-To/Check-the-loaded-document-is-edited.md new file mode 100644 index 000000000..510816f57 --- /dev/null +++ b/wpf/Pdf-Viewer/How-To/Check-the-loaded-document-is-edited.md @@ -0,0 +1,41 @@ +--- +layout: post +title: Check the loaded document is edited in PdfViewer | Syncfusion®; +description: Learn about how to Check the loaded document is edited in Syncfusion®; WPF Pdf Viewer control using IsDocumentEdited property. +platform: wpf +control: PDF Viewer +documentation: ug +--- + +# Check the loaded document is edited or not + +The PDF Viewer allows you to check whether the loaded PDF document has been modified during the viewing session. This helps determine if you need to prompt the user to save changes before exiting or closing the document.The [IsDocumentEdited](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_IsDocumentEdited) property of the PDF Viewer provides a simple way to determine whether the loaded document has been modified it's returning true,and false if no modifications have occurred. + + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + // Load the specified PDF file. + pdfViewer.Load("Document.pdf"); + // Attach an event handler to the Closed event of the window. + this.Closed += MainWindow_Closed; +} +private void MainWindow_Closed(object sender, EventArgs e) +{ + bool isPDFEdited = pdfViewer.IsDocumentEdited; + + if (isPDFEdited) + { + MessageBox.Show("The PDF document has been edited.", "Alert", MessageBoxButton.OK, MessageBoxImage.Information); + } + else + { + MessageBox.Show("The PDF document has not been edited.", "Alert", MessageBoxButton.OK, MessageBoxImage.Information); + } +} +{% endhighlight %} +{% endtabs %} +