SyntaxFix
Write A Post
Hire A Developer
Questions
It is also possible to open the pdf link in a new window and let the browser handle the rest:
window.open(pdfUrl, '_blank');
or:
window.open(pdfUrl);