Document preview is not showing characters correctly

Symptons

Document preview is not showing characters correctly,  are appearing squares instead of right characters.

Cause

There are missing fonts in the server and the conversion service - soffice - when converting the document to PDF

Diagnosis

You can locally open the document in your computer with libreoffice ( for example docx file with chinnese characters ) but when previewing in OpenKM you are getting squares in instead of right characters.

Solution

Install missing fonts in the server and restart openkm service ( usually will not be necessary restarting openkm service when installing new fonts, but sometimes seems java is not able to detect new fonts on fly and is needed restarting service.

Also is necessary clean cache conversion files. Go to Administration > Tools > Clean conversion cache.

In case you do not have this option - Clean conversion cache -  take a look at $TOMCAT_HOME/respository/ ,if you have a folder named "cache" , stop OpenKM, remove it, and start application again.

Installing microsoft fonts in ubuntu:

$ apt-get install msttcorefonts

Installing other true type fonts:

Create a folder, copy true fonts into and refresh fonts cache.

$ mkdir /usr/share/fonts/truetype/new

$ cp xxxx.ttf /usr/share/fonts/truetype/new/.

fc-cache -f -v

Installing microsoft fonts in CentOS:

$ yum install cabextract rpm-build
$ wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
$ rpmbuild -ba msttcorefonts-2.0-1.spec
$ rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
$ /sbin/service xfs reload

Properties

Properties

Date

2016-09-23

Applies to

  • Frontend
  • Core

Keywords

  • AllVersions
  •