How to reload

How can I performer a "reload" action of document in pdf viewer? It's possible?


1 Reply

VS Vasugi Sivajothi Syncfusion Team April 11, 2022 07:19 AM UTC

Hi Benjamin,


You can reload the current document using the load API in saveAsBlob() method. Please refer to the below code snippet and sample.


Code Snippet:


 

viewer.saveAsBlob().then(function (value) {

      var data = value;

      var reader = new FileReader();

      reader.readAsDataURL(data);

      reader.onload = () => {

      var base64data = reader.result;

      viewer.load(base64data, null);

      };

    });

 


Sample: https://stackblitz.com/edit/angular-b8uwxb?file=app.component.ts


UG: https://ej2.syncfusion.com/angular/documentation/pdfviewer/how-to/load-document/


Kindly try this and let us know if this suits your requirement. If not, please share more details about your requirement. This will be helpful to investigate further and provide the solution at the earliest.


Regards,

Vasugi.


Loader.
Up arrow icon