[OJS 3.3.0.7] PDF is not displayed correctly in PDF.JS PDF Viewer

Hello all,

I have a question which relates to the PDF.JS PDF Viewer plugin of OJS.

Usually, this viewer works quite well, but a short while ago a journal on our OJS-based platform published an issue which is not displayed correctly in the viewer. This is most apparent on page 7 of this PDF: https://epilepsiejournal.nl/issue/view/582/63. When the page is viewed in 0% to 125%, the text seems to glitch. Also see these screenshots below, which show the glitchy text.

Only when displaying the page in 150 percent or more, the glitchy display of letters is no longer the case. If I view the PDF in Adobe Acrobat Reader or Microsoft Edge’s PDF viewer, however, page 7 is displayed correctly, regardless of how far zoomed in or zoomed out the screen is. This leads me to believe that the PDF itself is not faulty, but that for some reason OJS’ PDF-viewer cannot display this file correctly. Would you know what causes this text to be displayed incorrectly?

Thank you very much in advance!

Plugin: PDF.JS PDF Viewer
Version: OJS 3.3.0.7

75 percent

110 percent

1 Like

Hi @HansSp,

The PDF reader that’s included in OJS is the PDF.js viewer, which is a third-party tool available here: PDF.js

If it’s not rendering a PDF correctly, you’ll need to raise the issue with that project.

It’s possible that OJS currently includes an older version of the plugin than is currently available; in that case, updating PDF.js to the latest should resolve the issue.

I would suggest testing your PDF with PDF.js outside of OJS to see how it renders.

Alternately, you may be able to tinker with your PDF generation settings in whatever tool you’re using to generate PDFs; this may result in a file that PDF.js can reliably render.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your swift reply, Alec! I will first look into the version of the plugin currently used. If we happen to run the latest version of the plugin on OJS, I shall test the PDF with PDF.js outside of OJS. Earlier issues of this same journal have always been rendered correctly, so if the typesetter makes some changes in the generation settings, that might lead to a correctly displayed PDF.

Hi Alec,

I found a small workaround that resolved the issue for us. Unfortunately, you need Adobe Acrobat (and not just the free Adobe Acrobat Reader) for this workaround, though there might be free alternatives that can do the same. I followed these steps:

  1. Open the PDF-file that did not display correctly in Adobe Acrobat.
  2. Select File > Save as other > Reduced File PDF.
  3. Choose 'Make compatible with: Acrobat 4.0 and later.
  4. Upload this version to OJS instead of the former version.

For some reason, this reduced file pdf was rendered perfectly by the PDF.JS PDF Viewer. Moreover, I did not see any differences in terms of quality between the original PDF and the reduced file PDF, so for us this workaround did the trick. Hopefully a similar approach could help
ohiray
as well (see this topic: OJS 3 -- PDF viewer).

Edit: I forgot to mention that we checked if we ran the most recent version of the PDF viewer-plugin and we indeed did.

2 Likes

Hi @HansSp,

I would stick with the work-around when you have problems. I suspect the issue will be resolved in time with the ongoing development of PDF.js, but the PKP team doesn’t maintain that (excellent) tool and doesn’t have much insight into its roadmap.

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 9 days. New replies are no longer allowed.