Opening a PDF in a new window & force download

Opening a PDF in a new window & force download

by Richard Crawford -
Number of replies: 0
We're having problems with the display of PDF files in our courses. If we select "same window", then the PDF is embedded in the page, but many of our users are unable to view the embedded document for various reasons. If we select "Force Download", then the browser plugin opens, but not all of our students are computer savvy enough to know to click "back" to get back to the course (and we lose navigation within the course anyway). If we set the PDF document to "new window", then it will be embedded in a new window, causing the same issues as before. Ideally, we would be able to both "force download" and "open in new window", but when I click the checkbox for "force download", I am unable to select "new window" in the drop-down box; and similarly when I select "New Window" from the drop-down box, the "force download" checkbox is disabled.

Now, I can do this by selecting "new window" and then entering "forcedownload" in the "Options" field in the appropriate row in the mdl_resources table, but I certainly don't want to do that for every PDF that we have (we have over 100 of them).

Is there a way to do this in Moodle? I'm not afraid of modifying code.
Average of ratings: -