Commit 46ad228b authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix to run libreoffice convert in the server side.

parent 176bb0f2
......@@ -36,10 +36,21 @@
#
# convert the HTML in ODT file
# the command Xvbf is available only in the server
# not in the development area
#
fi_tmp = TemporaryFile()
cmd = ["libreoffice", "--headless", "--convert-to", "odt", fhtml]
call(cmd, stdout=fi_tmp)
if os.path.exists('/usr/bin/Xvfb'):
cmd = "Xvbf :1 -screen 0 800x600x8 & "
cmd += "libreoffice --nologo --headless --invisible --display :1.0 --convert-to odt "
cmd += fhtml
call(cmd, stdout=fi_tmp, shell=True)
else:
cmd = ["libreoffice", "--headless", "--convert-to", "odt", fhtml]
call(cmd, stdout=fi_tmp)
fodt = '%s.odt' % froot
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment