2

I have certain sites I have to print generated PDF documents. They are not just PDF links but buttons to generate the PDF with selected content. They used to open up in browser or preview but now Safari just starts a download and I don't need all of these files on my drive. Firefox gives me the option to preview or download on the same site.

2 Answers 2

1

IF the important part of the question is wondering how to ensure that clicking on a PDF opens the document automatically, consider checking the radio ("Open safe files after downloading) in Preferences / General (by pressing + ,).

enter image description here

1
  • "I don't need all of these files on my drive" - well, this method still downloads the file.
    – Fuzzy76
    Apr 4 at 7:58
7

It is the web site that instructs the browser to download the PDF instead of viewing it:

Web sites usually controls this using the "Content-Disposition: attachment" header which is sent by the web server to the browser.

The web site probably changed from not sending this header to now sending the header, and so Safari will start a download instead of viewing the document.

In this case, I would suggest sending a feature request to the web site owner to let you have both a view and a download button for these PDFs.

Web sites also have the option of controlling this directly from HTML, although it is not as commonly used as the HTTP header. They do this by including am "download" attribute on the link itself (the "a" tag).

If that is the case, you could open the Developer Tools in Safari to manually edit the link and remove the download attribute before clicking. It is going to be quite tedious though.

2
  • Or, depending on how the PDF is generated (and if it is stored in the server for a certain time), it may be an <a> tag with the download attribute set. Apr 13, 2020 at 9:31
  • 1
    @IsmaelMiguel Good point!
    – jksoegaard
    Apr 13, 2020 at 11:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .