PDF is shown as binary text in browser instead of being downloaded

Posted on

Problem :

In Chrome, when I enter a URL to a PDF file, usually the browser’s Save dialog opens to save the PDF file to my hard disk, for example:


Now I have found a PDF URL where this, unfortunately, does not work:


With this PDF URL, no Save dialog is opened and the binary text of this PDF is shown in the browser:

enter image description here

Why is this and how can I make it download automatically when I click the URL?

OS: Windows 7 x64 SP1

Solution :

Why is this and how can I download this PDF file?

The website is broken and is not serving PDF files correctly. Contact webmaster@bmf.gv.at.

Using the Firefox developer tools (press f12, select “Net”, then select “All” we can see the response and request headers:

enter image description here

Content-Disposition inline;filename=U1a.pdf

The above tells the browser to serve the page content inline:

In a regular HTTP response, the Content-Disposition response header is a header indicating if the content is expected to be displayed inline in the browser, that is, as a Web page or as part of a Web page, or as an attachment, that is downloaded and saved locally.

You can open the PDF by saving the page locally and opening the PDF:

  1. Right click on the page and select “Save as” (or press ctrls)

    enter image description here

  2. Choose a directory and click “Save”.

  3. Navigate to the chosen directory in Explorer.

  4. Double click U1a.pdf.

the easiest way out here which is mention in this link is

  1. On your computer, open Chrome.
  2. Go to chrome://plugins.
  3. Under “Chrome PDF Viewer,” click Enable PDF viewing.

Leave a Reply

Your email address will not be published. Required fields are marked *