I\'m using: https://pdfobject.com/
To display an embedded pdf
file on my web app. However I cannot render a pdf
created from a blob>
This is what l believe you were looking for.
function previewPdf(billName) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'home/download?pdfBillId=' + billName, true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
if (this.status == 200) {
var file = new Blob([this.response], { type: 'application/pdf' });
var fileURL = URL.createObjectURL(file);
var viewer = $('#viewpdf');
PDFObject.embed(fileURL, viewer);
}
};
xhr.send();
}