From e76b45dae5278e218e69f9c07990f6b3421cdfaf Mon Sep 17 00:00:00 2001 From: Yaminisrisf4389 Date: Fri, 25 Oct 2024 16:31:56 +0530 Subject: [PATCH 1/2] 905578_hotfix --- wpf/Pdf-Viewer/Saving-the-PDF-document.md | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/wpf/Pdf-Viewer/Saving-the-PDF-document.md b/wpf/Pdf-Viewer/Saving-the-PDF-document.md index a6f5a479c..9b4575fd9 100644 --- a/wpf/Pdf-Viewer/Saving-the-PDF-document.md +++ b/wpf/Pdf-Viewer/Saving-the-PDF-document.md @@ -75,6 +75,35 @@ namespace SaveEvents {% endhighlight %} {% endtabs %} +### Canceling save in Save events + +The [BeginSave](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_BeginSave) event occurs before initiating the save operation of the PDF file. It also allows you to cancel the save operation using the [Cancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html#Syncfusion_Windows_PdfViewer_BeginSaveEventArgs_Cancel) property of [BeginSaveEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.BeginSaveEventArgs.html). The following code shows how to wire the event in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + // Wire the `BeginSave` event. + PdfViewer.BeginSave += PdfViewer_BeginSave; + // Load the PDF file + PdfViewer.Load("../../Data/Windows Store Apps Succinctly.pdf"); +} + +#region Events +private void PdfViewer_BeginSave(object sender, BeginSaveEventArgs e) +{ + // Insert your code here + + // Cancel the save operation + e.Cancel = true; +} +#endregion + +{% endhighlight %} +{% endtabs %} + ### End Save The [EndSave](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_EndSave) event occurs after the completion of the save operation. The [IsCanceled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.EndSaveEventArgs.html#Syncfusion_Windows_PdfViewer_EndSaveEventArgs_IsCanceled) property of the [EndSaveEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.EndSaveEventArgs.html) helps you to know whether the save operation is canceled or not. The following code shows how to wire the event in the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html). From f5e9bf654640aa7431dd9d7f866129ac3b13e05a Mon Sep 17 00:00:00 2001 From: Yaminisrisf4389 Date: Fri, 25 Oct 2024 18:49:43 +0530 Subject: [PATCH 2/2] 917118_hotfix --- .../Text-Annotation.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md b/wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md index 22b0a7f2b..691090330 100644 --- a/wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md +++ b/wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md @@ -132,6 +132,32 @@ End Sub {% endhighlight %} {% endtabs %} +## Setting the font family of the text annotation + +The font family of the text annotation can be customized either at the time of inclusion or after the inclusion. The following code shows how to set the font family of the text annotation at the time of inclusion. + +{% tabs %} +{% highlight C# %} + +private void Window_Loaded(object sender, RoutedEventArgs e) +{ + PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf"); + pdfviewer.Load(pdf); + pdfviewer.FreeTextAnnotationSettings.FontFamily = new System.Windows.Media.FontFamily("font family"); +} + +{% endhighlight %} +{% highlight vbnet %} + +Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) + Dim pdf As New PdfLoadedDocument(“Input.pdf”) + pdfViewer.Load(pdf) + pdfviewer.FreeTextAnnotationSettings.FontFamily = new System.Windows.Media.FontFamily("font family") +End Sub + +{% endhighlight %} +{% endtabs %} + ## Working with included/existing text annotations The included/existing text annotations are moved, resized, edited, customized, and deleted. To perform these operations, select the included/existing text annotation and right-click over the selected annotation, a pop-up context menu will appear with the following options: