Download file from S3

Hi Guys.

I'm trying to download a PDF file from an S3 bucket, but I'm facing a problem, when I put the link in anchor tag it wouldn't let me download the file because is protected, if I use DF API is ok S3.getFile()... I get my pdf, but how can I download that PDF or open it in a new window?.

I’ve tried several things but none is working:
window.open(“data:application/pdf,” + escape(result));
window.open("data:application/pdf;base64, " + result);
var file = new Blob([result], {type: ‘application/pdf’});
var fileURL = URL.createObjectURL(file);
window.open(fileURL, ‘_self’, ‘’);
window.open(“data:application/pdf,” + escape(result));

Thank you.