How can I help you?
Unload the PDF document programmatically
The PDF Viewer provides the unload() method to remove the currently loaded PDF from the viewer instance. Use this API to free memory or reset the viewer when navigating between documents or closing the viewer.
The following steps are used to unload the PDF document programmatically.
Step 1: Follow the steps provided in the link to create a simple PDF Viewer sample.
Step 2: Add the following code snippet to perform the unload operation.
<button (click)="unload()">Unload Document</button>unload() {
// Unload the PDF document.
var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
viewer.unload();
}Find the Sample, how to unload the PDF document programmatically