Here are the quick work around to convert.odc/.ppt to image or pdf file.
We need the following packages installed on the server,
a. openoffice
b. imagemagick
c. Java
Installing openoffice
#yum install openoffice.org*
#yum install ImageMagick*
How to verify imagemagick is installed and working
[root@rc-170 ~]# convert logo: logo.gif
[root@rc-170 ~]# convert –version
Version: ImageMagick 6.2.8 04/17/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Downloading jodconverter from sourceforge
#wget http://downloads.sourceforge.net/project/jodconverter/JODConverter/2.2.2/jodconverter-2.2.2.zip?use_mirror=nchc
#unzip jodconverter-2.2.2.zip
#mv jodconverter-2.2.2 /usr/local/jodconverter/ ( optional)
Verify the java installed
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
Now we need to run openoffice as a service. So we can create a init script for this. A sample scripts can be download from here
#!/bin/bash
OOo_HOME=/usr/lib64/openoffice.org
SOFFICE_PATH=$OOo_HOME/program/soffice
PIDFILE=$OOo_HOME/openoffice-server.pid
case “$1″ in
start)
if [ -f $PIDFILE ]; then
echo “OpenOffice headless server has already started.”
exit
fi
echo “Starting OpenOffice headless server”
$SOFFICE_PATH -headless -accept=”socket,host=127.0.0.1,port=8100;urp;” -nofirststartwizard & > /dev/null 2>&1
touch $PIDFILE
;;
stop)
if [ -f $PIDFILE ]; then
echo “Stopping OpenOffice headless server.”
killall -9 soffice && killall -9 soffice.bin
rm -f $PIDFILE
exit
fi
echo “Openoffice headless server is not running, foo.”
exit
;;
*)
echo “Usage: $0 {start|stop}”
exit 1
esac
exit 0
In this script I found the open office installation for was different according to the OS architecture. Since my OS is 64 bit it will be “/usr/lib64/openoffice.org” else it is “/usr/lib/openoffice.org” on Linux box.
[root@s15351481 ~]# vi /etc/rc.local then add the line “/etc/init.d/opeofficd start”
# java -jar /usr/local/jodconverter/lib/jodconverter-cli-2.2.2.jar document.ppt mam.pdf
You may use to call it from php using the “exec” funcation.
exec(‘java -jar /usr/local/jodconverter/lib/jodconverter-cli-2.2.2.jar/lib/jodconverter-cli-2.2.2.jar document.doc mam.pdf’);
This program will support for the following conversions,
1. DOC —> PDF
2. DOC —> ODT
3. DOC —> RTF
4. XLS —> PDF
5. XLS –> ODS
6. XLS –> CSV
7. PPT –> PDF
8. PPT —> ODP
9. PPT —> SWF
10. ODT –> PDF
11. ODT —> DOC
12. ODT —> RTF
13. ODS —> PDF
14. ODS —> XLS
15. ODS —> CSV
16.ODP —> PDF
17. ODP —> PPT
18. ODP —> SWF
How do I solve this error ?
[root@rc-040 installation]# /usr/lib/openoffice.org/program/soffice “-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager” -nologo -headless -nofirststartwizard
/usr/lib/openoffice.org/program/soffice.bin X11 error: Can’t open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See “man X” resp. “man xhost” for details)
[root@rc-040 installation]#
Yoy may need Xserver started on the server. I started the vnc server and execute the service script. Only this method will work.
How to check openoffice service is running,
We can test it either by telnet to the listening port or grep it from the process list.
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
`ufffdufffd'com.sun.star.bridge.XProtocolPropertiesUrpProtocolPropertiesO>?
AufffdD+ufffdXufffdu0771ufffdFqufffdu055d
^]
[root@rc-040 ~]# <strong>netstat -nlp| grep ":8100"</strong>
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 21278/soffice.bin
[root@rc-040 ~]#

Thanks for this article!
I noticed your article title says convert to .JPG or .PDF, but in the content of your article, “.JPG” is never mentioned, and none of the conversions listed are to .JPG ( i.e. “This program will support for the following conversions…”)
How could we get these files to be .JPG?
Your title says “convert to JPEG” but it seems that the openoffice server cannot convert to image files, just to PDF and some others… Am I missing something? Thank you
sorry for the confusion. I did not mean like that. but we can convert pdf –> jPG easily. This JOD convertor works only on GUI system having X server installed.
Thanks for correcting me
~liju