• PDF preview not working (sometimes)

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #52991  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 921 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
 #52993  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.