[OJS 3.3.0.13] Add PDF.js viewer on article landing page

Hi,

A journal has asked us to add a PDF viewer to the article landing page (and possibly to the general issue page as well).

How can I achieve this? (I’m not a coder.)

Should I create a specific template and include an iframe that references the PDF URL via the PDF.js viewer? If so, could you point me to a simple guide on how to do this?

Thank you in advance

Hi @andrea.colliv,

Your best option is probably to install the PDF.js PDF viewer in the plugin gallery. If you’re unfamiliar with how to work with plugins, please see here: https://docs.pkp.sfu.ca/learning-ojs/3.3/en/settings-website#plugins

-Roger
PKP Team

Hi @rcgillis, I’ve already installed it in the plugin gallery; but pdf.js viewer just opens the pdf in a new tab instead of downloading it.

Instaed, I’d like to see the pdf directly on the article page in a specific frame.

Hi @andrea.colliv,

Thanks for clarifying. Are you able to send a link to your site so I can witness the behaviour?

-Roger
PKP Team

I haven’t found an OJS example, unfortunately.
I’d like something like this on JSTOR: https://www.jstor.org/stable/420944?seq=1

Hi @andrea.colliv,

I requested a link to your site so I can see the erroneous behavior your describing. Could you send me a link to your site? I can have a look at JSTOR too to see what you’re hoping for, but it would be helpful to be able to see your site in order to see the PDF.js behavior.

-Roger
PKP Team

Ok, sorry for the misunderstanding!

The site is https://riviste.unimi.it/index.php/thereasoner/index, but it doesn’t have pdfs to the article level for now

You could find a similar use of PDF.js viewer on this other journal: https://riviste.unimi.it/index.php/fenestella/article/view/Fenestella_1-2020_Piva_Chartres

Hi @andrea.colliv,

Thanks for elaborating. I really like your site’s design, by the way.

I now see what you mean.

I see someone encountered a similar issue here :

Here are my best guesses, as well as a few suggestions to try:

  1. Incorrect server permissions or misconfigured download links. This resource goes into more detail about that.
  2. A possibly outdated or incompatible version of the PDF.js version plugin. Would you mind checking the version of the plugin that you’re using in the Plugin gallery?
  3. This could be a behaviour of the browser you’re using. Try accessing it in a different browser to see if that makes a difference.

-Roger
PKP Team

Hi @andrea.colliv,

I think you’re asking about how to present the PDF on the article’s landing page, instead of requiring users to follow a separate link.

There is a plugin that will do this for HTML galleys (the “Inline Html Galley” plugin), but I’m not aware of one that’ll do it for PDFs. You’d unfortunately need to code this.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like