[OJS] Firefox won't load PDF

Hello,

Using OJS version 2.4.4.1 and for some reason Firefox will not load the PDFs into the viewer. It works on all other browsers and the PDF plugin is enabled in Firefox and the preferences are set to open it in acrobat, but I still get the “The PDF file you selected should load here if your Web browser has a PDF reader plug-in installed (for example, a recent version of Adobe Acrobat Reader).” message. I tried opening the PDF in firefox outside of OJS and it opened just fine. Any ideas what might be causing this?

Thanks

Hi @mbauerCOM,

I’m not aware of problems with Firefox, but beware that the PDFObject library we’ve been using to present PDFs is known not to work with IE11. If you’re able to upgrade to OJS 2.4.6, you might try the PDF.js plugin that’s built in; it provides an alternative PDF viewer that’s known to work with all browsers.

Regards,
Alec Smecher
Public Knowledge Project Team

Yeah I’m stumped. Must be unique to me and my set-up. I’ll see if we can upgrade, but we’re just getting ready to release and not sure I want to risk an explosion. :smile:

On a related note: I tried enabling the “Google embedded viewer Plugin” to bypass Acrobat and instead of the PDF in the window I get a bunch of code:

Very strange. Any idea what might be causing that? Looks like the header.tpl template file it’s pulling for some reason.

Hi @mbauerCOM,

Are the articles publicly accessible, or are they behind a login? If Google’s viewer code can’t get the PDF directly from OJS, then something like this will happen. This plugin is only useful for journals that permit direct access to the PDFs without any kind of login. (I’ve also heard that they introduced a 2MB limit on PDFs.)

Regards,
Alec Smecher
Public Knowledge Project Team

Ah that explains it. Yeah it’s a future issue still so I was previewing it.

Thanks!

Could this also explain why on IE the PDF viewer loads the home page inside the PDF viewer?

And I’m referring to the default PDF viewer not the google doc one

Hi @mbauerCOM,

Possibly; PDFObject is known not to work with certain versions of IE. I’d suggest upgrading and trying the PDF.js plugin instead; if you still have problems with that, I can debug further.

Regards,
Alec Smecher
Public Knowledge Project Team

I’m a little worried about updating because I’ve edited and customized a whole bunch of the .tpl and xml files throughout OJS. Will updating undo all those?

Hi @mbauerCOM,

That depends on how much you’ve edited, and what, and whether the upgrade also hits those files. The upgrade documentation suggests using the standard diff/patch tools to preserve customizations; 2.4.4-1 to 2.4.6 isn’t a huge span, so I don’t expect you’ll have big conflicts to merge. Figuring out how to stay current is important. Internally, we use git quite heavily to manage modified installations and it permits us to update with a minimum amount of hair-pulling.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher and @mbauerCOM

I’m having a look at this thread because I’ve got a question related to PDF viewing. In the first issue we launched using OJS, the PDFs just automatically downloaded. No viewer, no viewing, nothing. Now, in the second issue, the PDFs are pulling up in a viewer, and predictably showing source code, which I understand is because they’re still in the “Preview” stage.

Could you help us begin to troubleshoot why it is that in the first issue, they were just automatic downloads, but in the second, they’re previewing in a browser PDF viewer?

Many thanks for your brainstorms.

MSJ

Hi @msengulj,

Check in the article_files table (specifically the file_type column) to see if the difference in behavior is because if a change in MIME types.

Regards,
Alec Smecher
Public Knowledge Project Team

IIRC version 2.4.8-2 displayed pdfs in Firefox correctly, but after upgrade to 2.4.8-3 I get:
The PDF file you selected should load here if your Web browser has a PDF reader plug-in installed

Chrome displays pdfs OK.

Can anyone confirm the problem with Firefox?

Hi @Nerijus_Baliunas,

OJS 2.4.8-2 looks fine to me with Firefox; do you have a journal URL you could share?

Regards,
Alec Smecher
Public Knowledge Project Team

On another PC FF displays PDFs OK, sorry for false alarm.

Oops, actually still not OK in one journal.

Hi @Nerijus_Baliunas,

I believe the first URL has the PDF.js plugin enabled in OJS, and the second does not.

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, that was it, thanks!

Hello asmecher, I’m facing the same problem on my journal. It cant open PDF full text nor download it![OJSPDF|690x399]. See it on the herein attached picture. please help(upload://sVyThmYGJlvHnseFg7V2rllxFO.jpeg)