Hi Burcu,
Thank you for contacting Syncfusion support.
In our PDF Viewer, we can use the unload method to unload the document from the viewer and use the destroy method to destroy the PDF Viewer. We have shared the React sample and code snippet for your reference.
Code snippet:
<button onclick ="unloadDocument()"> unloadDocument </button>
<button onclick ="destroy()"> destroy</button>
For Unload:
function unloadDocument() {
var pdfviewer = document.getElementById('container').ej2_instances[0];
pdfviewer.unload();
}
For Destroy:
function destroy() {
var pdfviewer = document.getElementById('container').ej2_instances[0];
pdfviewer.destroy();
}
|
Kindly try it and revert us, if you have any concerns about this.
Regards,
Dhivya.