How can we display a PDF using JavaScript from a base64 in Google chrome? As application:PDF,base64:pdfbase64binary is not working anymore
Asked
Active
Viewed 2,834 times
2 Answers
0
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.
guest271314
- 1
- 12
- 91
- 170