PDF.JS not finding PDF

Hello everyone,

I’m facing a problem that when I click to open any PDF (e.g.: https://revistas.pge.sp.gov.br/index.php/revistapegesp/issue/view/146 “Apresentação” PDF button), I’m directed to a page with the PDF.JS viewer open but blank (https://revistas.pge.sp.gov.br/index.php/revistapegesp/article/view/1322/1180) as shown in the print below:
image

I’m using OJS version 3.3.0.10

Can someone please help me figure out what’s going on?

Tiago Manzato

Have you recently changed hosting or servers?

  1. Is the path to your pdf files in config.inc.php correct? Please check it first.
    config.inc.php file “files_dir” line
  2. Do your pdf files stay in place?

Well, I just restored the site from the last working state and it seems to be working again, thanks anyway.

Got same error today so posting the solution that @kerimsarigul pointed but with a little more detail.

  1. Check your paths in config.inc.php (full review the full [files] section and ensure vars files_dir is ok)
  2. Set the right permissions to the files_dir folder.
    find /set/your/path/to/files_dir -type d -exec chmod 0750 {} \;
    find /set/your/path/to/files_dir -type f -exec chmod 0640 {} \;

After this, you will only need to refresh and your PDF will be shown.

1 Like

Hello everyone,

Sorry to re-open this discussion but I have the same problem. I try to resolve it with the chmod command given by @marc but there’s no improvement.
I’m currently using the 3.4.0.7 version but I tried localy with the 3.4.0.8 version and the problem was the same.
I don’t have any php errors except a error 500 on the download page :

https://rehab-journal.com/index.php/home/article/download/46/34/800

and an error in the pdfJsViewer.

The only clue I have is this :
in the file /ojs/pges/article/ArticleHandler.php I commented the lines concerning UsageEvent :

line 356 : event(new UsageEvent(Application::ASSOC_TYPE_SUBMISSION, $context, $article, null, null, $this->issue));
line 502 : event(new UsageEvent($assocType, $request->getContext(), $this->article, $this->galley, $submissionFile, $this->issue));

and it works fine!
Do you have any idea?