open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
33 stars 25 forks source link

Force downloading of PDF from confirmation page, instead of letting the browser open. #4488

Closed LaurensBurger closed 2 weeks ago

LaurensBurger commented 1 month ago

Thema / Theme

Frontend

Omschrijving / Description

Browsers are very eager to open pdf's for their users, but this behavior does not really fit with the kinds of PDF's that OF generates, which are definitely more of the kind you would want to actually save on your disk.

Since the user loses the ability to download the pdf again after the session is gone, the "Download PDF" should force a actual download of the PDF via the "download" attribute which seems to be supported by all modern browsers.

sergei-maertens commented 1 month ago

We'll need to do this server side, since the attribute does not work on cross origin downloads (which is the case with embedding)