Downloaded PDF looks empty although it contains some data
I'm trying to implement a PDF file download functionality with JavaScript. As a response to a POST request I get a PDF file, in Chrome DevTools console it looks like (the oResult data container, fragment): "%PDF-1.4↵%����↵4 0 obj↵<>stream↵x�� Now I'm trying to initialize the download process: let blob = new Blob([oResult], {type: "application/pdf"}); let link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = "tstPDF"; link.click(); As a result, upon a click on a button I get tstPDF.pdf , it contains the correct number of pages, but the PDF itself is