dolibarr/htdocs/includes/odtphp/odt2pdf.sh
Stephen L 6e1e41e8b5 update: Sync odtphp lib (fix a lot of bugs and add a few functionalities)
Ref: b4e02a1306

Signed-off-by: Stephen L. <lrq3000@gmail.com>
2013-04-07 17:27:35 +02:00

23 lines
427 B
Bash

#!/bin/bash
# @copyright GPL License 2010 - Vikas Mahajan - http://vikasmahajan.wordpress.com
if [ -f "$1.odt" ]
then
pgrep -U `id -u` soffice
if [ $? -ne 0 ]
then
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
sleep 2
fi
jodconverter "$1.odt" "$1.pdf"
if [ $? -ne 0 ]
then
echo "Error while converting odt to pdf"
exit 1
fi
sleep 1
else
echo "Error: Odt file does not exist"
exit 1
fi