Vous êtes sur la page 1sur 3

Step 1 - Using Open Office Headless for conversion (to be performed upon server) ================================================================================ = http://code.google.com/p/openmeetings/wiki/OpenOfficeConverter 1.

Install OpenOffice-Headless as root (through su, sudo, etc.): sudo apt-get install openoffice.org-headless 2. Create and edit a file named openoffice.sh (for example) with you favorite editor over /etc/init.d: 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

3. Change the permssions to this file: chmod 0755 /etc/init.d/openoffice.sh 4. Install openoffice.sh init script links: update-rc.d openoffice.sh defaults 5. Start the service: /etc/init.d/./openoffice.sh start 6. You can see if openofice is running with this command: netstat -nap grep office

=============== Install imagemagick apt-get install imagemagick-dbg --------------------------------------------------------------------------------Step 2 Install JODConverter (to be performed upon server)========================================================== #wget http://downloads.sourceforge.net/project/jodconverter/JODConverter/2.2.2/j odconverter-2.2.2.zip?use_mirror=nchc #unzip jodconverter-2.2.2.zip #mv jodconverter-2.2.2 /usr/local/jodconverter/ ( optional) -------------------------------------------------------------------------------Already done in Step 1, Need to do if that does not work ========================================================== Now we need to run openoffice as a service. So we can create a init script for t his. A sample scripts can be download from here #vi /etc/init.d/openofficed #!/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; wizard & > /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

-nofirststar

exit fi echo Openoffice headless server is not running, foo. exit ;; *) echo Usage: $0 {start stop} exit 1 esac exit 0 ------------------------------------------------------------------------------Step 3 - Final Step of conversion of PPT ========================================= # java -jar /usr/local/jodconverter/lib/jodconverter-cli-2.2.2.jar document.ppt myswf.swf 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 document.p pt mypdf.pdf); exec(convert mypdf.pdf myimage%d.jpg);

Vous aimerez peut-être aussi