Open Pdf In New Tab Instead Of Download

Posted on

And, when i click a link to PDF file, a new tab is opened (usually), the download progress bar is shown (which is actually from Adobe plug-in), and the file is 'finally' open after download is complete. Sep 22, 2014 - This will tell Chrome to use its built-in PDF viewer instead of downloading. After this is enabled, to download PDFs, just press command + S. Aug 24, 2007 - By default, PDF files opened from a web page display inside the. To install the extension, open Firefox and go the PDF Download page. HTML a href target _blank. The PDF Download extension is a free add-in that offers the user the choice of opening the PDF in the browser or in Acrobat. To install the extension, open Firefox and go the PDF Download page. Using PDF Download. Using the PDF Download extension is simple. When a link to a PDF is clicked, the window below will appear.

  1. Open Pdf In New Tab Instead Of Download Youtube
  2. Open Pdf In New Tab Instead Of Download
  3. Open Pdf In New Tab Instead Of Download Software
  4. Open Pdf In New Tab Instead Of Download Youtube

This question already has an answer here:

Open Pdf In New Tab Instead Of Download Youtube

  • Using Chrome, why is PDF downloaded from one site but displayed with Chrome pdf viewer from another site? 2 answers
  • How come Chrome opens some PDFs directly while DL others? 1 answer
  • Google Chrome 37 sometimes opens PDF in PDF viewer plugin and sometimes downloads PDF 1 answer

When I go to certain addresses of PDF files, Chrome downloads the PDF instead of opening it using its built-in PDF viewer. The page is then blank white.

There is no problem with my Chrome settings: I try addresses of other PDF files, and Chrome behaves as expected (I have it set to use Chrome's built-in PDF viewer). But every time I try the same problematic address, Chrome downloads the PDF and then displays a blank page.

I am using Windows 10 and ChromeVersion 63.0.3239.84 (Official Build) (64-bit).

My specific problematic URL this time is here (a Google search result). How to download using idm.

RgrthatRgrthat

marked as duplicate by randomDec 19 '17 at 5:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

Basically, this happens because the website tells the browser to do it. Occasionally, it's because the website developer decides they want this behaviour, e.g. common on file sharing sites. Other times, it's because it's a default option for whatever software they're using (e.g. forum or blogging software). Sometimes it's because the site dev has no idea what they're doing.

That's usually because the site sends a Content-Disposition header in the response. Specifically, it can send either inline or attachment.

inline is the default if not otherwise specified, and means the browser will open the file within the browser window if it is able to.

attachment means to always download the file, never attempt to open it inside the browser.

If you open your browser's developer tools, you'll see that particular link sends the following response headers:

This tells the browser to always download (attachment) the file, and to give it the default filename of Schubert-Sonata-21-B-flat.pdf rather than inferring it from the URL. Additionally, it does tell the browser (correctly) that it's an application/pdf file - but since it's an attachment the browser will still default to downloading.

Inline handling details

Open Pdf In New Tab Instead Of Download

When a Content-Disposition is inline (or unspecified), the browser will try to open the file in the default embedded viewer. This only works when the browser knows what file type it is, and the browser knows how to open that type.

Type detection

The file type can be specified by the server with a Content-Type header. For example, the most common inline types are text/html, application/javascript and text/css, making up the three major parts of a modern website. You can also have more esoteric types like application/pdf.

Another possibility is the server has specified a Content-Type of application/octet-stream. This is the most generic type, and it tells the browser that the file is just arbitrary data - at which point the only thing the browser can do is download it (in theory - we'll get to that).

When a Content-Type is not specified by the server (and sometimes even when it is), the browser can perform what is known as sniffing to try to guess the type by reading the file and looking for patterns.

Type handling

Upon receiving a file with an inline or unspecified disposition, the browser needs to try to open it within the browser if possible. To do this, it looks at the file type, and if it recognises the type it will try to open it. Most browsers will open any text/ type in a simple text viewer, will try to render text/html as a webpage, might open application/json in a special syntax-highlighted viewer, etc.

The type application/octet-stream was handled specially. Since it's supposed to be the most generic type, denoting an arbitrary stream of bytes, there isn't supposed to be any handler that can apply to all files of this 'type'. For example, in Firefox, this manifests as an inability to set the default handler for application/octet-stream.

Some websites have also used non-standard types. I've seen application/force-download used - which ends up as a download because the browser does not recognise or know what else to do with the type, but does not enjoy the special handling that application/octet-stream does.

A bit of a history lesson

To see how PDFs are handled, we can delve a bit into web history. See, in the past, browsers had no idea what a PDF is. So they could not open it. But we've seen PDFs being opened in browsers long before built-in PDF viewers were a thing, so how did that work?

It used to be possible to extend browser functionality with far more control than what you can do with limited extensions/addons these days. Those were most generically known as plugins. In Internet Explorer, they were ActiveX controls; in Mozilla Firefox and later Google Chrome they were NPAPI plugins. These plugins were capable of doing everything any other program could, and could additionally register themselves as a handler for a specific file type that might be otherwise unrecognised by the browser. (Incidentally, this was later found to be a huge security risk and support for these powerful plugins was gradually dropped..)

In the days of plugins, you would go and install Adobe Acrobat Reader, which would then install an ActiveX or NPAPI plugin that would register the application/pdf MIME type and tell the browser to open those types inline using the plugin.

Of course, after a number of security and performance issues caused by these plugins, the major browser vendors decided to incorporate their own PDF viewers while phasing out support for most plugins. The only one we still see is Adobe Shockwave Flash, which handles application/x-shockwave-flash.

There's actually still some leftover controls for this, e.g. in Firefox the Preview in Firefox option still exists:

In the past, this would have allowed the choice between multiple plugins that registered that type. For example, the list of registered types for Flash:

Those days were also before a lot of the media support that came with HTML5. It wasn't just PDFs - your browser would have no idea how to handle a MP4 container or H.264 video, no idea how to play a MP3 file, etc., etc. You would see plugins provided by media players like VLC or even Windows Media Player, or websites would embed a media player built in Flash.

BobBob

I found an explanation. According to an answer I found, it appears that Chrome will download a PDF if the MIME content type is set not to application/pdf but rather an 'incorrect or generic MIME type', application/octet-stream.

Furthermore, 'Most web servers send unknown-type resources using the default application/octet-stream MIME type. For security reasons, most browsers do not allow setting a custom default action for such resources, forcing the user to store it to disk to use it.'

RgrthatRgrthat

This is due to the HTTP Content-Disposition header specifying that the file is an attachment. This instructs the browser to download the file, rather than to open it directly.

There is a Chrome add-on that can override this behavior. The following image is from the Firefox developer tools:

bwDracobwDraco

Not the answer you're looking for? Browse other questions tagged google-chromepdf or ask your own question.

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.

pdeva
pdevapdeva

6 Answers

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.

starbeamrainbowlabsstarbeamrainbowlabs

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 featureshttp://www.blogsdna.com/828/seven-hidden-configuration-pages-of-google-chrome-browser.htm

Open Pdf In New Tab Instead Of Download

Hidden experimental features for version 8

about:flags

.

MoabMoab

The behavior of Chrome (and other browsers) depends on the 'content-disposition' HTTP header. If it is set to 'inline', it will auto-open if configured accordingly. If it is set to 'attachment', Chrome will offer to save it, regardless of other configurations.In other words, behavior will vary from site to site, just like you're describing. I don't know, however, if and how it could be made to open the PDF in any case; I'm afraid this might not be possible.

AbagneeleAbagneele

The ability to auto-open PDFs was disabled in recent versions of Chrome. The developers re-implemented the feature and it is available again in Chrome 10 and above.

See this bug report for details.

JoelJoel

Open Chrome and type 'chrome://plugins' without the quotes in the omnibox/url/search bar. Click Enable under the Chrome PDF Viewer. If you need to, restart chrome for it to take effect. Should be good to go.

wastintime99wastintime99

No need to download anything. It's a quick fix. 1. Open Chrome browser2.type in the following where you would normally type in a web address
chrome://plugins3. enable chrome pdf viewer by clicking on Enable

Open Pdf In New Tab Instead Of Download Software

Yes that simple...

Babymaker1974Babymaker1974

Open Pdf In New Tab Instead Of Download Youtube

Not the answer you're looking for? Browse other questions tagged google-chromepdf or ask your own question.