[TYPO3-doc] [Polluriel potentiel] Re: Convert OpenOffice document into HTML with externalized image

jean-sebastien_gervais at ssss.gouv.qc.ca jean-sebastien_gervais at ssss.gouv.qc.ca
Tue Apr 17 16:00:00 CEST 2012


Hello Fabien, 

With Alfresco, we use an openoffice converter in batch mode to convert 
*any* documents to pdf which is then converted with pdf2swf for document 
preview in the web page.   I'm pretty sure there's a switch in the command 
line to tell openoffice to save as html instead of pdf. 

Basically, to start the server, you need to start it as a job (with   & )  
or use and adapt my system V init script to start it as a service : 

-------------------------------


#!/bin/bash
#
# chkconfig: 345 20 100
# description: OpenOffice server listener
#

. /etc/init.d/functions

PIDFILE="/var/lock/subsys/ooservice"
PORT="8100"
USER="tomcat"
OOOPATH="/opt/alfresco/openoffice/program"
OOOUSERINSTALLDIR="file:///opt/alfresco/alf_data/oouser"

DAEMON="$OOOPATH/soffice -nologo -headless -invisible -nocrashrep 
-norestore -nofirststartwizard -env:UserInstallation=$OOOUSERINSTALLDIR 
'-accept=socket,host=localhost,port=$PORT;urp;' & > /dev/null 2>&1"



start()
{
        echo -n "Starting OpenOffice Server on port $PORT"

        if [[ -f $PIDFILE ]]; then
                RETVAL=1
                failure
                echo
                echo "A server is already active"
        else
                #mode headless ne doit pas avoir d'env graphique, sinon 
erreur "creation of executable memory area failed: Permission denied"
                unset DISPLAY
                #repertoire d'execution
                cd /opt/alfresco/alf_data/oouser
                export PATH=$OOOPATH:$PATH
                daemon --user=$USER $DAEMON
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch $PIDFILE
                echo
        fi
        return $RETVAL
}

stop()
{
        echo -n "Stopping OpenOffice"
        killproc soffice.bin

        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f $PIDFILE
        echo
        return $RETVAL
}

status()
{
        if [[ -f $PIDFILE ]]; then
                echo "OpenOffice is running."
        else
                echo "OpenOffice is not running."
        fi
        RETVAL=0
}

case "$1" in
 start)
        start
 ;;
 stop)
        stop
 ;;
 restart)
         stop
         start
 ;;
 status)
      status
 ;;
 *)
         echo "Usage: $0 {start|stop|restart|status}"
         RETVAL=1
        ;;
esac

exit $RETVAL




-------------------------------

Once you have a running openoffice server, all you need is to convert your 
document by specifying you want an HTML output.   JodConverter does 
exactly that. It connects to an open office server, sends the file, and 
waits for the transformed output. 
http://code.google.com/p/jodconverter/wiki/FAQ
http://code.google.com/p/jodconverter/wiki/GettingStarted


Good Luck ! 

Jean-Sebastien Gervais


typo3-project-documentation-bounces at lists.typo3.org a écrit sur 2012-04-17 
09:20:00 :

> De : Fabien Udriot <fabien.udriot at ecodev.ch>
> A : typo3-project-documentation at lists.typo3.org
> Date : 2012-04-17 09:30
> Objet : [Polluriel potentiel]  Re: [TYPO3-doc] Convert OpenOffice 
> document into HTML with externalized image
> Envoyé par : typo3-project-documentation-bounces at lists.typo3.org
> 
> Hi Martin,
> 
> > It works on the Mac if you open the document in OO and save it
> > manually as HTML: That produced the HTML file and each picture as a
> > file of its own.
> 
> Right. But I am seeking for a fully CLI way to achieve that. Opening
> a document and clicking the the
> "save as" button works for a few documents but is not ideal when 
> dealing with large number of documents.
> 
> Cheers,
> 
> Fabien
> _______________________________________________
> TYPO3-project-documentation mailing list
> TYPO3-project-documentation at lists.typo3.org
> 
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-documentation



More information about the TYPO3-project-documentation mailing list