Skip to content

Commit 4f51b01

Browse files
871183
1 parent dc69516 commit 4f51b01

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
layout: post
3-
title: Unload the document in WPF Pdf Viewer | Syncfusion
4-
description: Learn how the Syncfusion WPF PDF Viewer control automatically unloads the current document when loading a new one, eliminating the need for manual unloading.
3+
title: Unload the document in WPF Pdf Viewer | Syncfusion®
4+
description: Learn how the Syncfusion® WPF PDF Viewer control automatically unloads the current document when loading a new one, eliminating the need for manual unloading.
55
platform: wpf
66
control: PDF Viewer
77
documentation: ug
88
---
99

1010
# Unload the document in Pdf Viewer
1111

12-
PDF Viewer allows you to unload the PDF document with the [Unload(Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload_System_Boolean_) method of the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) and [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) classes.This method includes an optional Boolean parameter to control the disposal of the loaded document.When the parameter is set to true, the method fully disposes of the loaded document, releasing all associated memory and resources. By default, the parameter is set to false, which unloads the document without disposing of it completely, allowing it to be reused if needed.The following code sample illustrates the same.
12+
The WPF PDF Viewer also allows a user to Unload the PDF document using [Unload()](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload) API of the [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) and [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) classes.
13+
A user can dispose the PDF document by passing the Boolean parameter as ‘true’ to the [Unload(Boolean)](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload_System_Boolean_) API. The below code illustrates how to dispose the PDF document programmatically.
1314

1415
{% tabs %}
1516
{% highlight c# %}
1617

17-
private void button1_Click(object sender, RoutedEventArgs e)
18+
private void UnloadButton_Click(object sender, RoutedEventArgs e)
1819
{
1920
//Unload the PDF document
2021
pdfviewer.Unload(true);
@@ -23,13 +24,13 @@ private void button1_Click(object sender, RoutedEventArgs e)
2324
{% endhighlight %}
2425
{% highlight VB %}
2526

26-
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
27+
Private Sub UnloadButton_Click(sender As Object, e As RoutedEventArgs)
2728
'Unload the PDF document
2829
pdfviewer.Unload(true)
2930
End Sub
3031

3132
{% endhighlight %}
3233
{% endtabs %}
3334

34-
N>* In PdfViewerControl, it is recommended not to unload the PDF document externally when loading a new PDF document, as the control internally handles the unloading process.
35+
N>In PdfViewerControl, it is recommended not to unload the PDF document externally when loading a new PDF document, as the control internally handles the unloading process.
3536

0 commit comments

Comments
 (0)