Saving binary content of pdf file to javascript variable -
is possible save binary content of pdf javascript variable? have webpage url saving pdf file , need save pdf file javascript variable. guess should binary data.
you can use xhr response type blob
:
var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.pdf", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // `blob` contains pdf content }; oreq.send();
Comments
Post a Comment