My favorites | Sign in
Logo
                
Search
for
Updated Nov 27, 2009 by seba.wag...@gmail.com
Labels: Phase-Documentation, Installation
OpenOfficeConverter  
OpenOffice Converter Installation instructions

Starting OO in headless with Version OpenOffice 3.0 ++

Starting with OO 3.0 you do not need Xvfb anymore you can just use this:

Linux (Debian,Ubuntu)

Open Office 2.4 Debian, Ubuntu

There are some improvements related to Openoffice 2.4 version. If you have to run old versions of Openoffice for any reason, please find the old section below. With 2.4, no more xvfb framebuffer needed.

Installation steps (based on Etch 4.0 i386)

  1. Set backports for packages
  1. Install packages
  • Be sure all packages tagged with 2.4.0-4~bpo40+1
  • openoffice.org-headless,
  • openoffice.org-base, openoffice.org-writer, openoffice.org-calc, openoffice.org-impress, openoffice.org-draw, openoffice.org-math, openoffice.org-filter-mobiledev, openoffice.org-filter-binfilter, msttcorefonts, pstoedit, libpaper-utils, ttf-dejavu
  1. Write startup script for test
  • vi ooo.sh

unset DISPLAY
/usr/lib/openoffice/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard
  • chmod +x ooo.sh
  1. Run the oOo server as root.
  • sh ooo.sh
  • Check if server started with netstat -an | grep 8100
  • Should seem like tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN
  • Check you have soffice process running ps aux | grep soffice
  1. Test the conversion from command line
  • cd /usr/lib/red5/webapps/openmeetings/jod/
  • cp /home/userx/testme.ppt . (figure out the copy ppt file to your server, winscp?)
  • java -jar jodconverter-cli-2.2.0.jar -f pdf testme.ppt
  • The result normally should be like below
  • com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
    INFO: connected
    com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
    INFO: disconnected
  1. Login to openmeetings and check the conversion from there too.

Check List, Pay ATTENTION to this List!!!

webapp/src/app/org/openmeetings/app/remote/Application.java line 66 and change to your context (will be fixed in svn)

Todo List

Install Open Office Service on Debian/(K)Ubuntu (versions > 2.3)

  1. Install OpenOffice-Headless as root (through su, sudo, etc.):
  2. sudo apt-get install openoffice.org-headless
  3. Create and edit a file named openoffice.sh (for example) with you favorite editor over /etc/init.d:
  4. vi /etc/init.d/openoffice.sh
    #!/bin/bash
    # openoffice.org  headless server script
    #
    # chkconfig: 2345 80 30
    # description: headless openoffice server script
    # processname: openoffice
    # 
    # Author: Vic Vijayakumar
    # Modified by Federico Ch. Tomasczik
    #
    OOo_HOME=/usr/bin
    SOFFICE_PATH=$OOo_HOME/soffice
    PIDFILE=/var/run/openoffice-server.pid
    
    set -e
    
    case "$1" in
        start)
        if [ -f $PIDFILE ]; then
          echo "OpenOffice headless server has already started."
          sleep 5
          exit
        fi
          echo "Starting OpenOffice headless server"
          $SOFFICE_PATH -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /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."
          exit
        ;;
        *)
        echo "Usage: $0 {start|stop}"
        exit 1
    esac
    exit 0
  5. Change the permssions to this file:
  6. chmod 0755 /etc/init.d/openoffice.sh
  7. Install openoffice.sh init script links:
  8. update-rc.d openoffice.sh defaults
  9. Start the service:
  10. /etc/init.d/./openoffice.sh start
  11. You can see if openofice is running with this command:
  12. netstat -nap | grep office

You should get something like this:

tcp        0      0 127.0.0.1:8100          0.0.0.0:*
LISTEN     2467/soffice.bin 

Note: This script is based on Vic Vijayakumar's script at http://little.bluethings.net/2008/05/30/automating-document-conversion-in-linux-using-jodconverterooo/

Install Open Office Service on Debian/(K)Ubuntu Old Versions prior to 2.3

  1. Install OpenOffice
  2. sudo apt-get install xvfb openoffice.org
  3. Edit /usr/lib/openoffice/share/registry/data/org/openoffice/Setup.xcu
  4. After <node oor:name="Office"> insert the following lines:
  5. <prop oor:name="ooSetupConnectionURL" oor:type="xs:string">
       <value>socket,host=localhost,port=8100;urp</value>
    </prop>
  6. Launch :
  7. xvfb-run --server-args='-screen 0 800x600x16' -a /usr/lib/openoffice/program/soffice -headless -nologo -norestore

NOTE: Since OpenOffice 2.3 comes already with an build-in FrameBuffer there is no need for xvfb anymore.

Mac OSx

Install Open-Office from the Open-Office webside Normally it is installed into your Application folder. Goto file: /Applications/OpenOffice.org\ 2.0.app/Contents/MacOS/share/registry/data/org/openoffice/Setup.xpu

add the following after the node <node oor:name="Office"> :

                <prop oor:name="ooSetupConnectionURL">                                                                                                                               
                        <value>                                                                                                                                                      
                            socket,host=localhost,port=8100;urp;StarOffice.ServiceManager                                                                                            
                        </value>                                                                                                                                                     
                </prop>  

start x11/x-server (you can just start openoffice the normal way, close the openoffice app again but do NOT close the x-server/x-terminal, it will open a display for x11 on display :0)

open a new terminal and type:

sudo /Applications/OpenOffice.org\ 2.0.app/Contents/MacOS/program/soffice -display :0 -headless -nologo -norestore

OR

/Applications/OpenOffice.org\ 2.0.app/Contents/MacOS/program/soffice -display :0 -headless -nologo -norestore

sudo depends of your Red5 service .. if red5 is started as sudo (which must be started as sudo if the server is listening on port 80 (or smaller 1200) then ooservice also has to run as sudo cause it writes/reads from directories which red5 creates.

Windows

soffice.exe -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager
you should find a line:
TCP 127.0.0.1:8100 0.0.0.0:0 LISTENING

For more info see: http://www.artofsolving.com/node/11

Links


Comment by Pascal.Jacquin, Apr 14, 2008

On Debian the headless option (framebuffer buid-in implementation) require an additional package : openoffice.org-headless . Next to launch OOo converter, just type : soffice -headless -nologo -norestore -accept="socket,host=localhost,port=8100;urp"

Comment by kunthar, Jun 01, 2008

Debian etch users; openoffice.org-headless AND openoffice.org-java-common needed otherwise javaldx: Could not find a Java Runtime Environment! error occurs. do not forget to remove /userxxx/.openoffice2/ dir if you tried something.

Comment by Jai.edvanta, Jun 01, 2008

I am on Centos 5, I have installed openoffice but xvfb-run is not available.

Comment by kunthar, Jun 01, 2008

Openoffice 2.4 headless no more needs xvfb to run. Check the version of openoffice.

Comment by Jai.edvanta, Jun 02, 2008

I have edited /opt/openoffice.org2.4/share/registry/data/org/openoffice/Setup.xcu

Now when I start /opt/openoffice.org2.4/program/soffice -headless -nologo -norestore &

and then try to see port using lsof -w -n -i tcp:8100 I get nothing.

Comment by yyovkov, Jun 12, 2008

Hi Jai.edvanta, \\

You have to install this package "openoffice.org-headless-2.4.1-9310.i586.rpm"

Comment by reza.iskandar, Jun 27, 2008

after adding "deb http://www.backports.org/debian etch-backports main contrib non-free" at apt source.list. I get errors when run "apt-get update" W: GPG error: http://www.backports.org etch-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8E8B2116BA136C W: You may want to run apt-get update to correct these problems

Comment by sascha.xander, Sep 24, 2008

Hi Jai.edvanta, a bit late, but i think you must add -nofirststartwizard to the startline like mentioned above in the init-script example. otherwise soffice won't even start headless as far as i tested...

Comment by ykanomat, Feb 04, 2009

On the Mac, there seems to be 2 Setup.xcu files: /Applications/OpenOffice?.org.app/Contents/basis-link/share/registry/data/org/openoffice/Setup.xcu /Applications/OpenOffice?.org.app/Contents/basis-link/share/registry/res/en-US/org/openoffice/Setup.xcu

I am using Open Office 3.0.1 and not 2.0 in the setup listed.

Also the location of soffice has changed: /Applications/OpenOffice?.org.app/Contents/MacOS/soffice

Comment by gvanto, Feb 24, 2009

Does anyone know of a good combination of openoffice with headless package for Centos? I've installed openoffice.org3.0.1 on the server (using RPM package) but can't find a headless i586 package for it anywhere.

Getting headless to work on Centos seems to be a nightmare ...

Comment by akmzia, Apr 29, 2009

Hi, I am trying to install openoffice.org-headless, but get "Broken packages":

~# apt-get install openoffice.org-headless Reading package lists... Done Building dependency tree... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation:

The following packages have unmet dependencies:

openoffice.org-headless: Depends: openoffice.org-core (= 1:2.4.1-12~bpo40+1) but 2.0.4.dfsg.2-7etch6 is to be installed
E: Broken packages

Comment by mylesorme, Jun 28, 2009

On a CentOS 5 system, when i type:

/usr/lib/openoffice.org/program/soffice.bin -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;StarOffice?.Service"

I get ...

/usr/lib/openoffice.org/program/soffice.bin: /usr/local/lib/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)

Any ideas anyone?


Sign in to add a comment
Hosted by Google Code