I think that the problem sometimes occurs when the web server you are downloading the PDF from does not serve the PDF with the correct MIME type.
When the web server serves a PDF with the correct MIME type, Chrome previews it. When the web server serves a PDF with the incorrect or generic MIME type (application/octet-stream), Chrome downloads it.
If the server returns a Content-Type of text/html Chrome will display/open the PDF directly in the browser. However, if the server returns a Content-Type of application/pdf then the browser will prompt the user to save/download the PDF.
Set Chrome to open PDF rather than download them - Ask Different
open a pdf without having to save the document when using Chrome - Google Chrome Community
LPT: Chrome has an option to open and view a PDF without downloading it.
Simply Opening PDF's without Downloading
Videos
Sometimes I just want to look at a PDF, but when I click on the link Chrome starts downloading it. Is there any way to override this and cause PDFs to always open instead? I'm thinking Chrome does this based on some headers sent by the server, and I'd like to ignore those for PDFs.
Yeah, I know in both cases the data needs to be received from the server. I just want to make things easier for myself. Opening a PDF is a single click process. Downloading is multiple clicks plus having a file I probably don't want and will need to delete eventually.
I think that the problem sometimes occurs when the web server you are downloading the PDF from does not serve the PDF with the correct MIME type.
When the web server serves a PDF with the correct MIME type, Chrome previews it. When the web server serves a PDF with the incorrect or generic MIME type (application/octet-stream), Chrome downloads it.
If the server returns a Content-Type of text/html Chrome will display/open the PDF directly in the browser. However, if the server returns a Content-Type of application/pdf then the browser will prompt the user to save/download the PDF.
Download a PDF file, then when it is done, left click on the download icon at the bottom and select "always open this type of file" Now It should open any PDF link you click in that window without downloading it to a permanent location.
To undo it go into Options>Under the Hood tab>Clear Auto Opening Settings.
I also have the box ticked, "ask where to save each file before download", not sure if this has any affect on the behavior of automatically opening a file.
There may be some PDFs that chrome cannot display properly, so it offers you to download it to view with another PDF viewer. It is not a full featured viewer like Foxit or Adobe
I use it this way and can find no PDF that chrome has saved, it has to cache it somewhere to read it, but I am not sure where it does.
Some more info on chrome hidden features http://www.blogsdna.com/828/seven-hidden-configuration-pages-of-google-chrome-browser.htm
Hidden experimental features for version 8
about:flags
.
You will have to teach your Chrome how to Preview PDF's
For that you need to install a PDF preview "add on" in Chrome.
Automatically previews pdfs, powerpoint presentations, and other documents in Google Docs Viewer.
Or you can try this : You can normally open PDFs automatically in Chrome by clicking on the file you want to see.
If your PDFs are downloading instead of opening automatically in Chrome, Chrome PDF viewer could be turned off.
On your computer, open Chrome. At the top right, click More Settings. At the bottom, click Show advanced settings. Under “Privacy”, click Content settings. Under “PDF Documents," check the box next to "Open PDF files in the default PDF viewer application.” (Uncheck this box if you want PDFs to open automatically when you click them.)
Go to
chrome://settings/content/pdfDocuments
and flip the switch. No add-on needed.
On your computer, open Chrome.
At the top right, click More More and then Settings.
Under "Privacy and security," click Site settings.
Near the bottom, click PDF documents.
Turn off Download PDF files instead of automatically opening them in Chrome.
Chrome will now open PDFs automatically when you click them
Is anyone else getting completely fed up with these companies just screwing regular workers by doing the dumbest things you can imagine? For example, not being able to open a .PDF in the default application from a web browser. Like users have been able to do for years? The options are open in the browser or download. WTF is this? At first, I thought it was just Edge, nope it’s Chrome as well now. This keeps coming up more and more and I can’t seem to find a simple solution.
I have a client that is literally about to explode. They don’t want to have to download the pdf and then open it. They haven’t had to do it in years and they don’t want to do it now. Nor are they interested in using edge or any other browser to deal with PDF’s. They honestly open like 50 to 60 pdf’s a day and need all of the stuff in Adobe Pro. It’s literally what they do all day. Now it’s an extra step for god only knows why.
Now it’s on me to find a workaround because these dumbass companies (mainly Microsoft) just don’t care about their customers. Sorry I’m bitching but it’s gotten to a completely unacceptable level of complete ridiculousness.
Does anyone know why they are doing this? IE, a security reason. I’m trying to find a reason to explain to clients why it’s being done. Adobe is a $285 Billion company for a reason. People use the crap out of their software. That probably answers my question of why this happening, money. The clients don’t care about the tech. They just want to get some work done the same way they did it before. Not with extra hoops and jacking around.
So frustrated.
fd1211fb-2cdd-4819-a3d8-11ea8cf3c62d-chromepdf.png800×193 22.5 KB
06468574-d4e4-4789-a4d7-6c71e3dfac2c-edgepdf.png800×187 23.4 KB Both Edge and Firefox have a setting to open a pdf in the Windows default application. No idea about Chrome or Brave, I don’t use them.
To indicate to the browser that the file should be viewed in the browser, the HTTP response should include these headers:
Content-Type: application/pdf
Content-Disposition: inline; filename="filename.pdf"
To have the file downloaded rather than viewed:
Content-Type: application/pdf
Content-Disposition: attachment; filename="filename.pdf"
The quotes around the filename are required if the filename contains special characters such as filename[1].pdf which may otherwise break the browser's ability to handle the response.
How you set the HTTP response headers will depend on your HTTP server (or, if you are generating the PDF response from server-side code: your server-side programming language).
The correct type is application/pdf for PDF, not application/force-download. This looks like a hack for some legacy browsers. Always use the correct mimetype if you can.
If you have control over the server code:
- Forced download/prompt: use
header("Content-Disposition", "attachment; filename=myfilename.myextension"); - Browser tries to open it: use
header("Content-Disposition", "inline; filename=myfilename.myextension");
No control over the server code:
- Use the HTML5 download attribute. It uses the custom filename specified on the view side.
NOTE: I prefer setting the filename on the server side as you may have more information and can use common code.