• Cannot get LibreOffice document preview to work

  • 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.
 #19607  by nrdorf
 
Hello, I am an OpenKM "newbie" and have been going around in circles for the last couple days trying to get MS office type files to preview.

I'm not a newbie to linux, or to document management.

I have checked the wiki, and it has not been helpful as I am on 6.2.1 and most posts are referring to JBoss, not Tomcat

What I have working: OpenKM up and running, preview for PDF and image files work fine. Only .doc, .docx, .xls, .xlsx etc are problematic.

My OS is Ubuntu 12.04 LTS, 64 bit version

I started with LibreOffice, but when I ran into trouble uninstalled and loaded OpenOffice 3.4. That didn't help and I am now back on LibreOffice.

In the preview window I get a popup saying "Error in application/msword ...." to PDF" or "Error in application/vnd .... to PDF"

I can run soffice headless from the command line and convert the aforementioned doc and xl files to PDF no problem. However, If within OpenKM I select a document and then click on the PDF toolbar to generate a PDF, I get an error and the resulting pdf has a standard OpenKm message in it saying the conversion failed.

My path to libreoffice is /usr/lib/libreoffice, but I also tried /usr/bin/soffice and countless other strings. I have the port set to 8100, which is consistent with the startup string I have appended to catalina.sh:

## added this command to properly initialize OpenOffice as headless service \
exec /usr/bin/soffice --headless --nofirststartwizard --nologo --nodefault --accept="socket,host=localhost,port=8100;urp;StarOffice.Service" &

I also tried the prior suggesting appending setenv.sh with the following line:
export JAVA_HOME=/home/ndorf/openkm-6.2.1-community/java

I have zlib, jodconverter, unoconv all installed.

I'm just flat out of ideas....can anyone help me please?

Thanks!
 #19614  by jllort
 
Note: that is good practice install libreoffice from repositories ( I suppose you installed from there ).

Let's go step by step:
1- remove the command. exec /usr/bin/soffice etc..
2- Configure openkm parameter -> system.openoffice.path=/usr/lib/libreoffice
3- At parameters configuration table ( top right ) click on check button -> if all is right should see something like:
Code: Select all
system.openoffice.path
OK - /usr/lib/openoffice/program/soffice.bin
4- Stop tomcat
5- Ensure soffice service is stopped ( ps ax | grep soffice )
6- Take a look at log service tail -f catalina.log ( into tomcat/logs )
7- Start tomcat ( at end startup log -> soffice service should be started correctly )
8- Ensure soffice service is started ( ps ax | grep soffice )
9- Login to openkm and try convert document to pdf ( tool bar option ) -> continue looking at catalina.log to see if there's some error
 #19619  by nrdorf
 
Thanks...it's working now. I'll explain for everyone else's benefit what I think finally made the previewing work:

First of all, at the time I posted for help yesterday, I had done a complete un-install and re-install of OpenKM-

Previewing still did not work. My path was exactly as you specified in step (3) and the configuration test passed. I had not realized that OpenKM completes the "/usr/lib/openoffice" path by automatically (internally) concatenating "/program/bin" to the string. But besides that, I found a post elsewhere that indicates that the libreoffice sdk must be installed. Yes, I used the repositories in Ubuntu 12.04, but the sdk DOES NOT INSTALL by default. So in Synaptic I added "libreoffice-dev" to be installed. The previewing, after I did that, still did not work, and that's when I posted the message.

I had tested with and without the "exec /usr/bin/soffice" added to the catalina.sh

I think what actually may have made the difference was simple a complete reboot of my system after adding the SDK

Can you confirm for the entire forum audience that indeed, the SDK is a required component?

The current state of my working system is:

libreoffice installed from Synaptic using repos

no "exec" statement to start soffice in catalina.sh

Still have this statement in /tomcat/bin/setenv.sh:
export JAVA_HOME=/home/ndorf/openkm-6.2.1-community/java

jodconverter installed from Ubuntu Software Center
unoconv installed from synaptic

Thank you

now pressing onward to learn other aspects of the OpenKM application
:D
 #19649  by jllort
 
really libreoffice-dev should not be needed is strange ( and ubuntu is one of the most tested ditributions with openkm ).
 #19721  by mahyar
 
Hello,

I'm testing OpenKM thorughly to see if it meets all our requirements to be used in our company and I have been struggling with previews too and now I am just about to lose my mind.

What I have : OpenKM 6.2.4 on Ubuntu 12.04.1 LTS , KDE 4.8.5, Libreoffice 3.5.4.2 from rep, JodConverter 2.2.2.7 from rep, OpenJDK 6 JRE and IcedTea6 plugin from https://help.ubuntu.com/community/Java . My machine is an intel x86 laptop (more is irrelevant, right?)

What I did: I have done everything I noticed in Wiki and forum, but it is still not working for me. Already tried to manually start soffice headless and it does actually start, but I can not still have any documents converted in pdf.

I believe that there is something wrong with jodconverter and its connection to libreoffice, but I am totally clueless what it might be.
All the steps described in http://forum.openkm.com/viewtopic.php?f=4&t=8468#p19614 have been going smoothly, except 8.
According to nrdorf the libreoffice-dev should be installed too, which I have done. Setting the JAVA_HOME direcotry in setenv.sh is the only thing I have not still done. By the way, I have noticed that there are just two .dll files in /tomcat/lib/sigar. Is it supposed to be like this?

The log file is attached and was made like this: stoped Catalina, deleted log files, started catalina, logged in with okmAdmin, tried to download file as pdf, logged out, attached catalina.log.zip
log-file
(16.35 KiB) Downloaded 808 times
I will be very grateful, if any one could help me.

Thanks!
Mahyar
 #19735  by jllort
 
Could be some problem with your OS libraries compatibility with libreoffice. To ensure all is right test starting soffice from terminal.
Code: Select all
soffice "--accept=socket,host=localhost,port=2222;urp;StarOffice.ServiceManager" --nologo --headless --nofirststartwizard &
Take a look if there's some warning or error
 #19755  by mahyar
 
Hi and thanks for the answers,

first of all, there were no files in cache directory for PDF.

secondly, I have changed from libreoffice to openoffice V.3.2.1, because it was recommended in the Wiki. There was no errors before, when I started the soffice service from terminal, but now there is a warning, which seems not to be so relevant
Code: Select all
(soffice:6668): Gtk-WARNING **: /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/engines/liboxygen-gtk.so)
but the service starts.

Just one point. Should the port be 2222 or 8100 or 2002? It is supposed to be the same as the port given as the port number in OpenKM system.office.port, right?

The message "Error in application/msword ...." to PDF" or "Error in application/vnd.oasis. .... to PDF" means that there is something wrong with conversion, or reaching the service?

Update: went back to libreoffice, installed jodconverter again, service runs from terminal and listens to port 2002. No change in the situation.
Any chance that there is something wrong with jodconverter? As mentioned here http://www.artofsolving.com/node/13 , conversion to PDF can be checked like this
Code: Select all
java -jar lib/jodconverter-cli-2.2.0.jar document.doc document.pdf
and I get the error :
Code: Select all
Failed to load Main-Class manifest attribute from /usr/share/java/jodconverter-cli-2.2.2.jar
so I assume that there is something wrong with it, but I don't know what, why or how!
 #19762  by nrdorf
 
mahyar:

I have all the "uno" / "ure" components loaded in Synaptic. Not sure if they are needed but mine was a long road to get office docs preview to work. Entailed starting with LibreOffice, removing to try OpenOffice, then uninstalling to go back to LibreOffice, then adding the Uno Runtime Environment, JOD, Zlib1G and Zlib1g-dev, Libreoffice-dev (sdk) and then when it still didn't work, I had lots of PDF files in the cache, and only after removing them, all of a sudden office preview started working. (Ubuntu Desktop 64bit 12.04 LTS)

These are my relevant config settings:

system.swftools.pdf2swf : /home/myuserdir/openkm-6.2.1-community/tomcat/bin/pdf2swf -T 9 -f ${fileIn} -o ${fileOut}
system.openoffice.path: /usr/lib/libreoffice (the actual path to soffice.bin is /usr/lib/libreoffice/program/soffice, but OpenKM automatically populates the remainder of the path internally.)

system.openoffice.port: 2002
system.imagemagick.convert /usr/bin/convert
system.ghostscript.ps2pdf /usr/bin/ps2pdf

Neil
 #19771  by mahyar
 
Hi nrdorf and thanks for the advices,

I have installed all the mentioned packages and some more, just in case!
There must be something wrong with JOD ver.2.2.2-7, the files I have differ from the ones in the package presented in artofsloving.com. Apparently there must be a way to install this package or at least make libreoffice and/or OpenKM use this one since it works fine with the started soffice service. There is also a ver.3 which I don't know how to install. It seems that JOD can not see my running office. I am totally confused now, because it did actually work before. Maybe there are some packages deleted by mistake.

Thanks again and hope there could be some way to make it work
 #19782  by nrdorf
 
mahyar:

I checked my JODconverter package version in Synaptic and I have:

jodconverter 2.2.2-7

and

libjodconverter-java 2.2.2-6

I can't say for certain if both packages are required, but probalby no harm in installing the libjodconverter-java if you haven't already. Worth a try anyway.
 #19793  by mahyar
 
I already have both, there must be some problem. Trying to convert the documents directly using java -jar jodconverter(xxx).jar ... returns the error
Failed to load Main-Class manifest attribute from jodconverter(xxx).jar
I am trying on another server now. Hope it works, got a meeting in few days and I must be presenting and comparing two DMS softwares and the boss must decide.
 #19830  by jllort
 
This kind of error is not good
Code: Select all
(soffice:6668): Gtk-WARNING **: /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/engines/liboxygen-gtk.so)
althought in wiki recomend some version you should found the correct version you must install in your OS. Depending your OS you need to install latest or older soffice version. I can not help you identifying which is what should be installed in your OS but the soffice command in your SO should be started without this kind of warning. Only I can suggest install debian or ubuntu, because repositories have the correct libreoffice you need in redhat / centos familly is more harder install the correct version
 #19964  by mahyar
 
Hi again, a short update of my situation.

I uninstalled the professional 6.2.4 version and installed the community 6.2.1 version and preview works just fine. Then installed the trial version again on the same machine (literally, everything the same, just two folders beside each other!) and still the old problem is present. Does anyone know, if anything must be changed to make 6.2.4 version show the previews?
It is not vital to have this feature working at the moment, but it bothers me so much that I can not focus on the other aspects of OpenKM.
Thanks

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.