Skip to content

DOCINFRA-2341_merged_using_automation #1540

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 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions wpf/Pdf-Viewer/Saving-the-PDF-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
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