Search results

Unload the PDF document Programmatically in ASP.NET Core PDF Viewer control

21 Oct 2021 / 1 minute to read

The PDF Viewer library allows you to unload the PDF document being displayed in the PDF Viewer control programmatically using the unload() method.

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.

Copied to clipboard
<button type="button" onclick="unload()">Unload Document</button>

    // Unload the PDF document.
    function unload() {
        var viewer = document.getElementById('pdfViewer').ej2_instances[0];

Download the Sample, how to unload the PDF document programmatically