This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2021-03-16T11:44:34.045Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = 'https://<your pdf endpoint>'; | |
let filename = 'File.pdf'; | |
let xhr = new XMLHttpRequest(); | |
xhr.responseType = 'blob'; // set response type to blob | |
xhr.onreadystatechange = () => { | |
if (xhr.readyState == 4 && xhr.status == 200) { | |
// create a blob with the content in XHR's response: | |
let blob = new Blob([xhr.response], { type: 'application/pdf' }); |