How can we display a PDF using JavaScript from a base64 in Google chrome? As application:PDF,base64:pdfbase64binary is not working anymore
How can we display a PDF using JavaScript from a base64 in Google chrome? As application:PDF,base64:pdfbase64binary is not working anymore
You can use a Blob URL to represent the file.
fetch(<data URI>)
.then(response => response.blob())
.then(blob => {
// do stuff with `Blob URL`
const blobURL = URL.createObjectURL(blob);
});
See Creating a Blob from a base64 string in JavaScript, also Base64 PDF in new tab shows Blank Page before Refresh.