Skip to content

UG documentation about changing the Font Family of Free text annotation #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions wpf/Pdf-Viewer/Working-with-Annotations/Text-Annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down