here is a very simple script to run openoffice headless.
it works on a debian sarge, you have to do this before :
# apt-get update && apt-get install xvfb
here is the code :
Code: |
#!/bin/bash
echo ———–DEBUT export PATH=$PATH:/usr/bin/X11 xvfb-run -a /usr/bin/openoffice -invisible “macro:///Library.module1.go($1)” date |
it runs a macro with openoffice as the www-data user.
u have to prepare macro before.
see that u can pass a parameter to the macro via the shell script.
i call the shell script from a php script that looks like this :
Code: |
// appeler ooo $cmd=(“/path/to/script.sh argument > /dev/null 2>&1”); exec($cmd); |
echo and date are usefull for degugging the shell script before calling it from php.
i use those scripts in a web application. ooo is in charge of generating pdf files.