Open file as Blob or String[Base64]

Hi Syncfusion Team,


I would like to open a file directly in Pdf Viewer to make a quick preview without saving the file. I won't be using toolbar for that. File will be given from our repository to Pdf Viewer programmatically.


How to do it, cause the only example I found in yours documentation uses path to file which I of course do not have?


Best regards,


2 Replies

VS Vasugi Sivajothi Syncfusion Team July 29, 2021 02:09 PM UTC

Hi Ignacy, 
 
Thank you for contacting Syncfusion support. 
 
You can load Base64 data in the PDF Viewer using load method. Please refer to the below code snippet and sample, 

Code snippet: 
viewer.load(“data:application/pdf;base64,…..”,null); 

 
Kindly try this and let us know if you have any concerns about this. 
 
Regards, 
Vasugi. 



IM Ignacy Mielniczek July 30, 2021 07:52 AM UTC

Hi Vasugi,


Works great. Thank you!


Loader.
Up arrow icon