Any thoughts
Hi Ellen,
Forcing the download as Mary suggested only means that the browser will not try to display the file but will present you with an option to open or save it. If you chose 'Open' the file will be opened in your default pdf viewer application (most likely Acrobat reader). We found this gives us the most consistent behaviour across different browsers and operating systems.
The issue could have another reason though. We found that Windows XP behaves differently compared to Vista. We too have trouble with opening pdf file on some of our Vista machines; computers running XP don't show the issue. Our technicians are investigating as we speak.
Christoph
Ellen
We were having all of the above issues in IE and FF. A simply update to Adobe Reader 9 fixed all of these problems.
Regards
Greetings Barbara
It sounds like there are a mixture of different but equally awful problems with these pdfs!
Some wish to force a download and there is a setting for that as Mary says; some wish the opposite - to open the pdf in the browser i.e. within a Moodle page (the latter is definitely my preference so as to keep the work-flow flowing, but I don't always get what I want).
In all cases you are at the mercy of how the browser on the client machine is set up, as unlike mp3 or flv files (for example) Moodle does not hand out the reader/player for the pdf file-type.
So if the experience is flaky you should be looking at the browser installation, and consequently making it work on one machine doesn't make it work across your establishment!
If you run Firefox 3.0 on a Mac (OS X 10.4) you will probably find that irrespective of what you ask for in Moodle the pdf is only ever offered as a download, and after I had banged my head against a brick wall for a while I read (but unfortunately now can't find!) a note on Adobe's site to say that the Acrobat Reader Plugin is not supported for Firefox 3! In other words hard luck folks!

To confirm this I go to Firefox->Preferences->Applications and sure enough the only item available to PDF types is 'Preview' i.e Download to the Preview application!
This would probably explain why back-tracking to an older Firefox (and thus with it an older Reader plugin that was supported) did make it work on Mac.
It may also mean that trying to get the old plugin to work on the new browser will crash it!
By contrast if I look at Firefox 3.0.1 on PC (running XP) and go to Tools->Options->Applications then PDF files are set to 'Use Adobe Acrobat (in Firefox)', and sure enough, the PDF opens happily within the browser on my Moodle page!

Then if I try exactly the same thing in IE7 on PC and look at Tools->Internet Options->Programs->Manage Add-ons I have entries for 'Adobe PDF Reader' (ActiveX Control), and 'Adobe PDF Reader Link Helper' (Browser Helper Object). Both are enabled, and the pdf opens in the browser in the Moodle page exactly as expected.

Now back at the Mac, this time in Safari 3.1.2, I go to Help->Installed Plugins and find that PDF file-types and a load of others from Adobe are handled by the AdobePDFViewer.plugin, and naturally this means I get to see the pdf in the Moodle page again. Now there's a surprise


So all this suggests that if you have a crashing browser you may have tried mix-and-match with plugins - you have to use the right one for your browser;
...if you only get offered the download when you wanted the in-page reader then you haven't got the plugin installed or enabled (or it doesn't exist!!!);
...if you work around the Firefox/Mac problem by installing a third-party plugin no-one else will have it so your site won't behave the same on the next machine;
...and if you work for Adobe its about time you swallowed the fact that most Macs (and a big selection of PCs) use Firefox and offer us the plugins we need!

I hope that helps. Regards,
John
i thought i was going to have Force download on all the .pdf ressources but now i just post the instructions
cheers
V
Your information seems clear and very useful. We have encountered some additional, seemingly related problems not addressed:
- Once the "Force download" setting is "set" it does not allow you to unset it.
- On many occasions the "Force download" setting will not "stick". Even though you cannot change it once its set (as mentioned in #1) when you return, it is unset and the pdf document doesn't load correctly. I've seen this happen before my eyes. And I've seen it happen after days go by.
- I can access the very same pdf document from the same course using the same computer on the same browser (Firefox) with the same version in two different instances of Moodle (1.65+ and 1.92+) and have the earlier open it without a problem while 1.92+ won't.
There is plainly an interaction between moodle and the browser that is tricky to deal with.
On point 1 I think I would try actually editing the database to see if fixes the unset issue. You can open the table mdl_resource and find the named pdf in question.
If you have set this to Force Download you will find that its 'options' field is set to 'forcedownload'.
You can switch to edit mode, using the pencil icon, and just delete the 'forcedownload' setting. Then click Save.
For point 2, I wondered if you were using 1.9.2 weekly updates? As I don't know whether such an update would reset these resources to default.
Though perhaps this is not the connection at all!
And point 3 does suggest that there is a database difference that is causing issues - but what I don't know!
Regards,
John
could this be a cookie issue?
something tracking that a particular pdf resourse has already been opened straight into Preview and so repeating the same process enough after you have changed the setting?
JW
If you look at that code it there are a load of routines that try to determine the correct headers etc... quite convoluted.
Also, one error we saw was a reference to a security issue bringing in content from another domain, i.e. embedding external PDF's. I dont know if some browser setting was treating this like some kind of XSS exploit... seemed a bit weird. I suppose that would imply that perhaps the way embedding of files has changed on 1.9.
It would be worth adding the 1.6 / 1.9 comparison to the bug tracker.
I am experiencing all the mentioned behaviours since I started with our Moodle 1.7 18 months ago. From time to time we had students complaining about PDF (and other docs) not opening in IE 6 and later IE 7. We advised to use FireFox 2 or right klick in IE to open the File in a new window or tab. Then I upgraded to 1.9.2+ and everything seemed to work again and some weeks ago things worsened and we had to advise again the trick with right mouse click. Then I found a Microsoft KB article (http://support.microsoft.com/kb/815313/en-us) explaining the "force download" option for https sites like our Moodle. Once this option set, things seemed to work again.
There is also an open issue in the Tracker: http://tracker.moodle.org/browse/MDL-9614
But today students complained again and I was not able to open PDFs any more. So my actual workaround is to set the "force download" option in Moodle for every resource. But you see that this would mean a lot of work for all teachers having to change this option on every PDF and other Docs they uploaded.
And nobody seems to know how long this workaround will give us a rest in the whole affair. FireFox 3 has also been reported to me from Teachers does not refresh the submitted pages, so that changes can not immediately be seeen.
Rosario
Here's a couple of things to add to John White's nice summary of some of the variations (I'm using Moodle 1.9.3 Build 20080723.):
From John:
Now back at the Mac, this time in Safari 3.1.2, I go to Help->Installed Plugins and find that PDF file-types and a load of others from Adobe are handled by the AdobePDFViewer.plugin, and naturally this means I get to see the pdf in the Moodle page again. Now there's a surprise.
This is true (with recent versions of Adobe Reader - at least 8 and 9) ONLY IF Adobe Reader itself is set to Display files in web browser using...Reader (Reader/Preferences/Internet). If you turn this off, Safari will use its own built-in Webkit (and will not show the Adobe plugin as loaded), but will still display the PDF within the browser window. (Make sure you quit and re-launch Safari after changing this Reader setting.)
Also, the Safari Help instructions on Viewing PDFs refer only to the Webkit-based viewing. They note that mousing over the bottom of the PDF page opens a toolbar with several options including Open PDF in Preview and Save PDF to downloads folder. (Open in Preview actually opens the file in Reader if that is your default app for PDFs.) The Adobe plugin based display of the PDF has different controls, always visible at top of the displayed file.
Short of tinkering with the Safari code in ways that most of my users aren't equipped to do, there does not appear to be any way to get Safari to immediately open a PDF in an external app.
From John:
Then if I try ... in IE7 on PC and look at Tools->Internet Options->Programs->Manage Add-ons I have entries for 'Adobe PDF Reader' (ActiveX Control), and 'Adobe PDF Reader Link Helper' (Browser Helper Object). Both are enabled, and the pdf opens in the browser in the Moodle page exactly as expected.
Here too, "Adobe PDF Reader" shows as an add-on ONLY IF Reader is set to Display PDF in browser (Edit/Preferences/Internet). Turn this off and IE 7 will respond to direct links to PDFs by opening them outside of the browser.
BUT (and this is nasty!), if you have a Resource link in Moodle to a PDF which is not set as "Forced Download", clicking on that link brings up a Moodle resource page with a big empty hole for the PDF above the summary (unlike FF3 which instead provides a direct link to the PDF to allow it to be opened externally).
So, for my Mac users, I'm saying: set Adobe Reader to NOT display PDFs in browser, and then use Firefox if you want PDFs displayed outside the browser, Safari if you want them displayed in the browser (though I don't recommend Safari for Moodle use).
For my PC users, I have to tell them to leave Adobe Reader at its default config of Display PDFs in browser, because otherwise IE breaks with files not set for Force download. In this case, they can use FF3 if they always want PDFs displayed externally, or IE7 if they want them displayed in the browser.
Martin
Hi Martin,
I think Iñaki commited yesterday one fix into CVS for this "blank space in IE" http://tracker.moodle.org/browse/MDL-14541
Today, no such problem, and as far as I can tell I'm testing with all the same parameters!! Something must be different but I can't figure what.
With Moodle 1.9.3, FF3 (Win) does have a (replicable) version of this problem. Under these same conditions, FF3 (Win) brings up the Moodle resource page with a hole where the PDF would be (though no outlined box as I'd experienced with IE), but does also automatically open the PDF in Reader.
I've mitigated this problem by editing /mod/resources/type/file/resource.class.php so that the summary displays above the PDF rather than below it.
I'll take a look at Mauno's fix later.
http://code.google.com/p/firefox-mac-pdf/
Though the pdf was set to force download, it opened in a new window - still, it was viewable. (It also opened for view in a new window on Windows with FF 3.)
Thanks for the reference, but in the answer there lies the problem!
You can of course install a plug-in (in this case the Quartz plug-in) to make Firefox behave with pdfs. But you have to install it on EVERY target machine that might access your site. Or at very least put the reference to the plug-in and tell client computer users to install it!
This still remains a very unsatisfactory situation. Whereas if Adobe supplied Firefox with a plug-in (or Firefox was permitted to write/modify one) and it was packaged in a Firefox upgrade, the problem would disappear almost overnight!
Politics!
John
Firefox is fine with XP, and IE is fine for both XP and Vista - it is only the Firefox/Vista combination which is a problem for me.
Does anyone have any suggestions?
Thanks.
Interestingly, it used to work for me with Vista, Firefox 3.0.5 and Moodle 1.9.3+. The problems have appeared since I upgraded to Moodle 1.9.4 yesterday.
Any suggestions please? Or do we have to Force Downloads for all PDFS?
Thanks.
I supposed another option that lots have taken is to replace Vista with XP. I believe MS is releasing an SP for Vista momentarily..... and that may cure some ills....
Of course, one could argue that you should use a reliable OS, but I imagine you really don;t want to hear that.....
I have reported the error, and I can't find anything on the mozilla site.
I've tried disabling the acrobat plugin, and the result is that it asks me if I want to download or open using acrobat, and it will then open, but it appears on the download bar so it is must be downloading, and I don't really want it to download every pdf I look at.
I've tried looking in the Vista system log, but don't really know what I'm looking for.
I've also looked at the crash report, and it says "Crash reason: Exception Access Violation". Does this help at all?
Thanks.
In the interim, I spent 5 minutes and can suggest the following may be of interest:
a) clean out all acrobat and reinstall to make sure you have the latest version and nothing else.
b) peruse the following thead http://www.adobeforums.com/webx/.59b5bfca
c) check out these URLS:
http://kb.adobe.com/selfservice/viewContent.do?externalId=328233
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb404291
-Alasdair
As Alasdair says, it does seem to be a problem with Moodle. I have no problem displaying pdfs in Firefox from other websites, and if I click on a pdf within my Moodle files, it opens with no problem. It is only in resources where Moodle embeds the pdf within the page, that the crash happens.
I can work round this by using IE or by disabling my Adobe plugin, but I'm wondering how widespread this problem is - do all Vista/Firefox/Moodle users have the same issue?
what application are you referring to in which you tick the "force download" option?

The problem was resolved by upgrading to Adobe Acrobat Reader 9.
moodle/mod/resource/type/file/resource.class.php
around line 254 in the "pdf bit" change $embedded = true; to $embedded = false;
} else if ($mimetype == 'application/pdf' || $mimetype == 'application/x-pdf') {
$resourcetype = "pdf";
$embedded = false;
Around line 322 add another condition to the if statement that forces download, i.e. add " || $resourcetype == "pdf" ":
if ($resource->options == 'forcedownload' || $resourcetype == "pdf") {
$fullurl .= $forcedownloadsep . 'forcedownload=1';
}
I could not find and admin setting to do this site wide from Moodle, and am assuming a code change is the only way to do it on a site wide basis?
Regards
Mariana
I will try and get more info to post to the bug tracker, but that would explain why earlier versions still work.
He said its a bit of a hack but it is possible to get it working.
Looking at the bug tracker:
http://tracker.moodle.org/browse/MDL-13818
It seems that it was not decided to implement that work around, as it is "not a Moodle issue".
That tracker then refers to:
http://tracker.moodle.org/browse/MDL-13903
where the "solution" is to force download.
That is what my change above does... force download, but it would be better if you used the patched files from the am tracker.
Sooooo it seems there is an IE7 workaround but the developers have decided not to persue that option.... instead forcing download of PDF's in Moodle. Perhaps they anticipate that Adobe / Microsoft will resolve the issue in their upgrades.
Jez
The problem exists not only for files you link to through resources. We had trouble with .doc files linked to from html page type resources. The solution for us was a hack which is described here (including a link to the Modules and plug-ins database). The beauty of this approach is that you have control over what file types are forced to be downloaded.
Christoph
The .mp3 link works fine in the other browser versions and other browsers, but not in IE7. Anyone else having this problem?
(And please Headquarter, come with a workaround for IE7!)
IE7 has had this problem ever since I installed 1.9.2. I could see no PDF file directly from the browser but the whole file would appear when I clicked the "Direct Link" option. Now sometimes the file does not appear after the "Direct Link" option.
FF3 just began having this problem a couple of weeks ago. The PDF file seems to show up from the browser the first time I request it but subsequent requests are commonly blank (not always -seems random) and I can't open a window image with the "Direct Link" option, however, the download window shows that the download occurred. What is interesting and possibly a clue is that when the PDF text does not appear from the browser, the pop-up window has scroll bars as if there were some text there - it is just blank.
I installed using Fantastico - I see there is a new upgrade available via Fantastico but the version number is not identified. Considering some problems that always crop up with new upgrades, I'm leery of doing this during the quarter.
Could this have to do with the browser blocking pop-ups?
we just installed the 1.9 version and started uploading a few documents. Initially the pdfs were opening and there was no issue. After a while, the PDFs were not opening in the frontpage or as part of the course. However, on the same system, the document opens from Site files without any issue ruling out any browser installation / configuration problems.. Wonder what the reason could be??
It works fine in IE 7.
Mariana
I have noticed that when replacing a pdf with a more recent version in Moodle that afterwards the browser (Firefox) crashed when trying to load the pdf to view. I noted that this problem was unique to Firefox browser as the file loaded in IE and Chrome. I cleared recent history in Firefox and afterwards the pdf loaded no problem.
Is anyone having this trouble?