How to Download a PDF File forcefully instead of opening it in a Browser using JS. Docs » General » How to Download a PDF File forcefully instead of opening it in a Browser using JS I have set it to "Use PDF-XChange Editor (default). Now files open in that program, however it still always asks me if I would like to save or open the file, even though I have selected "Do this automatically for files like this from now on". Note that from most websites, the PDF just open without asking if I want to save or open. So here’s a simple snippet for when you want to force a download of a file (such as a PDF, .doc etc), when a link is clicked. The default action will open the document in the either the same browser window, or in a new tab/window by using the usual target methods: Open file in … Continued On my most recent assignment I was faced with the challenge of downloading a pdf file from an API and displaying it in the browser. Normally, the API would provide a json-object with a link to the pdf, which can then be used to open a new browser tab/window and the browser or platform takes care of the rest. If you don't have a program that will open them at all, Windows will only allow saving. If you do have Office, check you file associations to see what those file extensions are mapped to. Go to Settings and in the search bar at the top, type 'extensions' and choose the option 'Choose a default app for each type of file'