Skip to content

Commit 2af43c8

Browse files
authored
Merge pull request #1558 from syncfusion-content/871183
871183-Whether need to unload externally, before loading new document
2 parents 1c1fd48 + 05ffde7 commit 2af43c8

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

wpf-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@
15481548
<li><a href="/wpf/Pdf-Viewer/acquiring-current-page-being-displayed">Acquire current page being displayed</a></li>
15491549
<li><a href="/wpf/Pdf-Viewer/enabling-and-disabling-notification-bar">Enable and Disable Notification bar</a></li>
15501550
<li><a href="/wpf/Pdf-Viewer/how-to/Disable-the-Undo-Redo-operation">Disable the Undo Redo operation</a></li>
1551+
<li><a href="/wpf/Pdf-Viewer/how-to/Unload-the-document">Unload the document</a></li>
15511552
</ul>
15521553
</li>
15531554
</ul>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
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.
5+
platform: wpf
6+
control: PDF Viewer
7+
documentation: ug
8+
---
9+
10+
# Unload the document in Pdf Viewer
11+
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. 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.
13+
14+
{% tabs %}
15+
{% highlight c# %}
16+
17+
private void UnloadButton_Click(object sender, RoutedEventArgs e)
18+
{
19+
//Unload the PDF document
20+
pdfviewer.Unload(true);
21+
}
22+
23+
{% endhighlight %}
24+
{% highlight VB %}
25+
26+
Private Sub UnloadButton_Click(sender As Object, e As RoutedEventArgs)
27+
'Unload the PDF document
28+
pdfviewer.Unload(true)
29+
End Sub
30+
31+
{% endhighlight %}
32+
{% endtabs %}
33+
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+

0 commit comments

Comments
 (0)