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>
Try using element, requesting resource as a
Blob
html
javascript
var xhr = new XMLHttpRequest();
// load `document` from `cache`
xhr.open("GET", "/path/to/file.pdf", true);
xhr.responseType = "blob";
xhr.onload = function (e) {
if (this.status === 200) {
// `blob` response
console.log(this.response);
var file = window.URL.createObjectURL(this.response);
document.querySelector("iframe").src = file;
}
};
xhr.send();
plnkr http://plnkr.co/edit/9E5sGfMhUeIWV9yodAUd?p=preview