I am experiencing difficulties with downloading PDF files in my SAPUI5 application. The issue lies in receiving a base64 string from the backend system, but struggling to convert it and display it as a PDF.
I can successfully convert and download smaller sized base64 files, but when it comes to larger PDF files, the download fails. Any assistance on this matter would be greatly appreciated.
Could someone kindly assist me with this?
var data =" JVBERi0xLjQNJeLjz9MNCjc1MDEgMCBvYmogPDwvTGluZWFyaXplZCAxL0wgOTM2NDM1Mi9PIDc1MDMvRSAxMjE3ODgvTiA1M...";
var uri = 'data:application/pdf;base64,' + atob(data);
var link = document.createElement("a");
link.href = uri;
link.style = "visibility:hidden";
link.download = object.FileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);