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(); 

source: sending , receiving binary data, mdn


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -