Page 1 of 1

PDF preview not working (sometimes)

PostPosted:Mon Nov 08, 2021 2:43 am
by stiebs
I've recently (over the past 6 weeks ago, can't pinpoint exactly when) had some issues previewing some PDFs. I often scan paper documents using my Fuji ScanScap S1300i document scanner, which auto OCR's them. If any editing is required (removing blank pages, etc) I'll edit in PDF-Xchange editor before importing into OpenKM.

For years this has worked fine. But now, most of my documents that were imported using this process are no longer shown in the document preview window in OpenKM. Other PDFs (eg, electronically received invoices and bills) still work fine.

If I download the PDF, I can still read it fine. There are also PDFs that I know for certain at the start of this year I could read in the preview pane and now I can't. So definitely something with the PDF preview, not the PDF creation.

With the broken PDFs, the pages are still shown, but it appears there is some issue rendering the text - I can select the text, and cut'n'paste it elsewhere, I can't see it:

pdf-preview.png
pdf-preview.png (23.15 KiB) Viewed 1037 times
I'm not sure if this started with an OpenKM upgrade, or Debian package update along the way somewhere.

I can't seem to find any errors being generated, but maybe I'm looking in the wrong spot?
In the tomcat/logs directory, localhost_access_log.yyyy-mm-dd.txt shows me access to the preview, but I don't see any errors anywhere (I've checked catalina.out, openkm.log, and the apache logs)

Running OpenKM CE 6.3.11 on Debian
Code: Select all
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/frontend/Document HTTP/1.1" 200 199
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/frontend/Auth HTTP/1.1" 200 137
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/frontend/Auth HTTP/1.1" 200 206
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/frontend/PropertyGroup HTTP/1.1" 200 48
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "GET /OpenKM/preview/pdfjs/viewer.html?file=%2FOpenKM%2Ffrontend%2FConverter%3FtoPdf%3D                                                                true%26inline%3Dtrue%26uuid%3D28fc8cef-aabe-4241-ac29-58482f6a7308 HTTP/1.1" 200 18979
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/extension/Stapling HTTP/1.1" 200 48
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/extension/Wiki HTTP/1.1" 200 14
192.168.1.26 - - [08/Nov/2021:13:30:22 +1100] "POST /OpenKM/frontend/PropertyGroup HTTP/1.1" 200 195
192.168.1.26 - - [08/Nov/2021:13:30:23 +1100] "GET /OpenKM/frontend/Converter?toPdf=true&inline=true&uuid=28fc8cef-aabe-4241-ac29-584                                                                82f6a7308 HTTP/1.1" 200 793211
192.168.1.1 - - [08/Nov/2021:13:30:24 +1100] "POST /OpenKM/frontend/UINotification HTTP/1.1" 200 48

Re: PDF preview not working (sometimes)

PostPosted:Mon Nov 08, 2021 2:59 am
by stiebs
Aah, as usually I find the answer after posting the question.

I found this post:
viewtopic.php?t=24323

That refered to this issue:
https://github.com/openkm/document-mana ... issues/300

I will post an update if the upgrading the pdfjs works.

Re: PDF preview not working (sometimes)

PostPosted:Mon Nov 08, 2021 3:46 am
by stiebs
Downloading and manually copying the pdfjs files from the downloaded zip file as specified in the issue I linked above, and then clearing browser cache worked perfectly.

I copied the pdf.js and pdf.worker.js from the build folder into the tomcat/webapps/OpenKM/preview/build directory
Then I backed up and removed the tomcat/webapps/OpenKM/preview/pdfjs directory, and replaced it with the web folder from the pdfjs package.