Skip to content

Commit 3734c70

Browse files
871183
1 parent 4ed45bc commit 3734c70

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

wpf/Pdf-Viewer/How-To/Unload-the-document.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ documentation: ug
99

1010
# Unload the document in Pdf Viewer
1111

12-
PDF Viewer allows you to unload the document with the [Unload](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload) 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. The following code sample illustrates the same.
12+
PDF Viewer allows you to unload the document with the [Unload](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload) 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.The Unload method is used only for unloading the document. The following code sample illustrates the same.
1313

1414
{% tabs %}
1515
{% highlight c# %}
@@ -25,12 +25,34 @@ private void button1_Click(object sender, RoutedEventArgs e)
2525

2626
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
2727
'Unload the document
28-
pdfviewer.Unload();
28+
pdfviewer.Unload()
2929
End Sub
3030

3131
{% endhighlight %}
3232
{% endtabs %}
3333

34-
N>* In PdfViewerControl, there is no need to manually unload the current document before loading a new one.
35-
N>* The control automatically unloads the previous document after the new one has finished loading. This built-in functionality ensures seamless transitions between documents without requiring additional code for manual unloading.
36-
N>*However, if you want to explicitly unload a document,you can use the Unload method.
34+
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 includes an optional Boolean parameter to control the disposal of the loaded document. When this parameter is set to true, the method fully disposes of the loaded document. By default, the parameter is set to false.
35+
36+
{% tabs %}
37+
{% highlight c# %}
38+
39+
private void button1_Click(object sender, RoutedEventArgs e)
40+
{
41+
//Unload the document
42+
pdfviewer.Unload(true);
43+
}
44+
45+
{% endhighlight %}
46+
{% highlight VB %}
47+
48+
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
49+
'Unload the document
50+
pdfviewer.Unload(true)
51+
End Sub
52+
53+
{% endhighlight %}
54+
{% endtabs %}
55+
56+
N>* In PdfViewerControl, it is recommended not to manually unload the document externally.
57+
N>* The control internally handles the document unloading process.
58+

0 commit comments

Comments
 (0)