Issue with pdfJsViewer plugin

Hi there,

I’m running the latest version of OJS with pdfJsViewer installed and enabled. When I click on any PDF links, my browser downloads a file named viewer.html instead of showing the PDF file as supposed… When I disable the pdfJsViewer plugin, the browser now downloads the PDF file as supposed to be.

Any help would be appreciated. Thanks!

Hi @jimnault,

What OJS version are you using?
Is there any relevant in PHP logs when you trying to view PDF when the plugin is enabled?

Hi, I’m running OJS 3.1.2.1 and there’s nothing relevant in the logs unfortunately…

Hmm, is there any information in browser’s console log? Is this behaviour consistent across browsers?

Hi,

I’ve just checked the console log and yes there’s an error showing up: “Resource interpreted as Document but transferred with MIME type application/x-httpd-php”

Seems that this is why this happens, but I don’t really know how to solve it…

Do you have access to the database?
Information about galleys is stored in the submission_galleys table. You can find there problematic galleys by submission_id and labels. Also, you can find there file_id and then by this parameter in the submission_files table - > find file_type. Does the file type for PDF galleys look like application/pdf?