[Solved] PDF.JS not working on 3.1.1-4 in any browser

Greetings! I have 3.1.1-4 running fine on XAMPP, but we would like visitors to open PDFs in their browsers, while right now the only option is to download them. Enabled the PDF.JS PDF Viewer plugin and restarted Apache, but nothing changed. I read the PDF.JS not working on 3.1.1-4 thread on the same issue, but that issue seems to be unresolved.

I tried IE, Chrome, Firefox on Windows PCs and Safari on Mac - when I click on the PDF button under and article, I need to download first, then open. Interestingly, in Safari on iPhones, clicking this PDF button opens the PDF right in the browser, w/o the downloading step, but I’m not sure it’s because of the plugin.

I don’t have any errors, just missing the functionality. Could someone help me?

Maybe @asmecher, @bozana and other OJS gurus could nudge me in the right direction? My editors are telling me PDFs were opening in browser in 2.4.5 before the migration and want the same functionality in 3.1.1-4, but I have no idea what to do! :frowning:

Suddenly, PDFs started to show. The only explanation I have is that before I asked this question, I enabled PDF.JS in Administration → Site Settings - Plugins only.

Yesterday, I enabled it in Dashboard → Settings → Website → Plugins and voila, PDFs are opening in the browser now.

Hello,

I was not able to find the Dashboard → Settings → Website → Plugins section, even when connected as the OJS administrator. Where is it?

Regards,

Oberdan

Hi @Oberdan,

Is there a plugins/generic/pdfJsViewer directory in your installation?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

Yes, the directory exists:

root@portal:/ojs_temp/rc-3.1.1/plugins/generic/pdfJsViewer# ls
index.php  LICENSE  locale  pdf.js  PdfJsViewerPlugin.inc.php  README  settings.xml  templates  version.xml

Regards,

Oberdan

Hi @Oberdan,

Do you have separate Site Administrator and Journal Editor/Manager accounts? If so, try finding Dashboard > Settings > Website > Plugins with a Journal Manager or Journal Editor account.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

Using a journal manager account and enabling PDF.js Dashboard > Settings > Website > Plugins worked just fine. But why I’m not able to activate plugins for all journals as administrator?

Regards,

Oberdan

Hi @Oberdan,

Only certain plugins will appear in the site-wide plugins area – it’s not intended as a place to perform batch operations, e.g. enabling a journal-specific plugin for all journals.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher

Well, even if I have to enable the plugins for each journal, it’s OK, as long as we can upgrade. There are still some translations to correct, but apart from that, most problems are now solved. Thanks!

Regards,

Oberdan

1 Like