From b2167f4b972dfcb1822a2bc3da0a8c37762ecd9d Mon Sep 17 00:00:00 2001 From: Yaminisrisf4389 Date: Fri, 25 Oct 2024 11:06:55 +0530 Subject: [PATCH] 917118 --- .../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: