Skip to content

Commit 1f5968c

Browse files
Merge pull request #1540 from Syncfusion-Content/hotfix/hotfix-v27.1.48
DOCINFRA-2341_merged_using_automation
2 parents c10e49f + 77a6402 commit 1f5968c

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

wpf/Pdf-Viewer/Saving-the-PDF-document.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,35 @@ namespace SaveEvents
7575
{% endhighlight %}
7676
{% endtabs %}
7777

78+
### Canceling save in Save events
79+
80+
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).
81+
82+
{% tabs %}
83+
{% highlight c# %}
84+
85+
public MainWindow()
86+
{
87+
InitializeComponent();
88+
// Wire the `BeginSave` event.
89+
PdfViewer.BeginSave += PdfViewer_BeginSave;
90+
// Load the PDF file
91+
PdfViewer.Load("../../Data/Windows Store Apps Succinctly.pdf");
92+
}
93+
94+
#region Events
95+
private void PdfViewer_BeginSave(object sender, BeginSaveEventArgs e)
96+
{
97+
// Insert your code here
98+
99+
// Cancel the save operation
100+
e.Cancel = true;
101+
}
102+
#endregion
103+
104+
{% endhighlight %}
105+
{% endtabs %}
106+
78107
### End Save
79108

80109
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).

wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,32 @@ End Sub
132132
{% endhighlight %}
133133
{% endtabs %}
134134

135+
## Setting the font family of the text annotation
136+
137+
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.
138+
139+
{% tabs %}
140+
{% highlight C# %}
141+
142+
private void Window_Loaded(object sender, RoutedEventArgs e)
143+
{
144+
PdfLoadedDocument pdf = new PdfLoadedDocument("Input.pdf");
145+
pdfviewer.Load(pdf);
146+
pdfviewer.FreeTextAnnotationSettings.FontFamily = new System.Windows.Media.FontFamily("font family");
147+
}
148+
149+
{% endhighlight %}
150+
{% highlight vbnet %}
151+
152+
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
153+
Dim pdf As New PdfLoadedDocument(“Input.pdf”)
154+
pdfViewer.Load(pdf)
155+
pdfviewer.FreeTextAnnotationSettings.FontFamily = new System.Windows.Media.FontFamily("font family")
156+
End Sub
157+
158+
{% endhighlight %}
159+
{% endtabs %}
160+
135161
## Working with included/existing text annotations
136162

137163
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:

0 commit comments

Comments
 (0)