Google-chrome – How to open pdf in Chrome’s integrated viewer without downloading it

google-chromepdf

So I was really excited about the new integrated pdf viewer in chrome.
However when I click on a pdf file link, chrome offers to download it instead of opening it inside its viewer.

How do i get it to open pdfs inside its viewer?

Edit: I have found that it behaves kinda randomly. Sometimes it does open it inside its viewer and sometimes it asks to download it.

In gmail though it always asks to download it.

Note: I already have the 'ask where to save each file before downloading' option unchecked.

Best Answer

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.