I have created a small piece of script that calls an API to get a PDF and sends the responseType as arraybuffer.
Using this I create a new Blob and set the type as 'application/pdf'
To force this to download I create an anchor element, pass it the blob and click it.
This works fine locally and on other browsers on my test servers but on Chrome I get Failed - No file in the download bar.
The PDF is definitely available as I can paste the url to the API into a tab and see it and the response from the original API call is passed to the Blob.
Sample Code
var fileName = 'dummyFilename-' + offerId + '.pdf'; var blob = new window.Blob([resData], { type: 'application/pdf' }); var anchorElement = document.createElement('a'); var url = window.URL.createObjectURL(blob); document.body.appendChild(anchorElement); anchorElement.id = 'anchorElement'; anchorElement.hidden = 'true'; anchorElement.href = url; if (typeof anchorElement.download !== 'undefined') { anchorElement.download = fileName; } else { anchorElement.target = '_blank'; } anchorElement.click();