Skip to content

Commit 4ed45bc

Browse files
871183
1 parent f2b81dd commit 4ed45bc

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,28 @@ documentation: ug
99

1010
# Unload the document in Pdf Viewer
1111

12-
The [Unload](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_Unload) method of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) allows you to unload the pdf document.The following code snippet illustrates unload the pdf document in the PdfViewer.
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.
1313

1414
{% tabs %}
1515
{% highlight c# %}
1616

17-
pdfviewer.Unload();
17+
private void button1_Click(object sender, RoutedEventArgs e)
18+
{
19+
//Unload the document
20+
pdfviewer.Unload();
21+
}
1822

19-
{%endhighlight%}
23+
{% endhighlight %}
24+
{% highlight VB %}
2025

21-
{% highlight vb %}
26+
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
27+
'Unload the document
28+
pdfviewer.Unload();
29+
End Sub
2230

23-
pdfviewer.Unload()
24-
25-
{% endhighlight%}
31+
{% endhighlight %}
2632
{% endtabs %}
2733

28-
N>* In PdfViewerControl, there’s no need to manually unload the current document before loading a new one, as the control automatically unloads the previous document after the new one has finished loading.
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.

0 commit comments

Comments
 (0)