How to force Google Chrome to only download PDF but not open them
Recent changes to Google Chrome altered how PDF files are handled. My extreme preference is that PDF files are only downloaded. I will then open the file in my system default PDF viewer if needed.
When I'm downloading several manuals that pertain to a specific piece of equipment, I do NOT need to view those manuals immediately. My goal is to simply download them to local storage as quickly as possible.
Chrome v56 no longer allows the built-in viewer to completely disabled. The only option is to go to Settings -> Content -> tick the box that says to open the PDF file in the system default PDF application.
This is NOT what I want. Quite simply, I do NOT want the PDF file to open automatically at all. Save the file; do NOT open the file.
I have tried right-clicking the download link for the PDF file and selecting "Save Link as ..." but that behavior has now changed as well. Specifically, most of the time, what gets downloaded is a URL rather than the PDF file.
FWIW - my download setting in Chrome points to the top-level directory in my Download folder and the check box "Ask where to save download file" is ticked.
Is there any way to persuade Chrome to revert back to previous behavior and just download the file to local storage?
Solution 1:
There is a setting for this now (Version 61):
Go to: chrome://settings/content
Scroll down to the PDF-documents section and select option to Download PDF files
Not sure exactly when this was changed. In version 58 there is a similar option to Open PDF files in the default viewer, but this has the same effect in linux (possibly different on other platforms).
Solution 2:
The issue may have to do with the way files are served by web servers.
Some servers may include Content-Disposition: attachment
header in their response leading to Chrome downloading the file when you click on the download link while others may skip that header in their response, leaving the decision of whether to open or download the file up to Chrome.
More info on this here:
Force to open “Save As…” popup open at text link click for pdf in HTML
Do I need Content-Type: application/octet-stream for file download?
The following solution will download all PDF files including embedded files meant to be viewed within Chrome like the one's here and here. However, it won't work for sites using PDF.js to display embedded PDF files, like this online demo.
Adding or modifying Content-Disposition
headers on the fly to Content-Disposition: attachment
for MIME type application/pdf
should help force Google Chrome to download all PDF files.
You can achieve this with the Modify Content-Type extension.
- Install the extension and click on the extension icon in the toolbar and select Options
- Click on Add Rule and add the following rule:
Name: Download PDFs URL Filter: .* Original Type: application/pdf Replacement Type: application/pdf Disposition: attachment
- Click Save Rule
- Refresh the page containing the PDF links so that the extension is loaded for that that page