Skip to content
Browse files

Adding better error messages for when they can't connect to a LibreOf…

…fice server
  • Loading branch information...
1 parent 1856d90 commit 0f58ec0265d9d40cdb17f1abad76d004310b71ff @holloway committed Sep 20, 2011
View
21 README
@@ -1,6 +1,27 @@
Docvert 5.1
Released under the GPL3 see LICENCE
+REQUIREMENTS
+ Python 2.6 with lxml.
+ pdf2svg and rsvg.
+
+OPTIONAL LIBRARIES
+ If you want to convert Microsoft Office files you'll need:
+ LibreOffice or OpenOffice.org server (which can run 'headless')
+ PyUNO (python-uno)
+
+ To set this up on DEBIAN/UBUNTU/MINT just run
+ apt-get install docvert-libreoffice
+ or
+ apt-get install docvert-openoffice.org
+
+ Alternatively, if you want to do it manually then run (change the path to
+ your install of LibreOffice/OpenOffice.org)
+ /usr/bin/soffice -headless -norestore -nologo -norestore -nofirststartwizard -accept="socket,port=2002;urp;"
+
+ This runs a single instance. If you want to run a pool of instances then
+ try something like http://oodaemon.sourceforge.net/
+
WEB SERVICE http://localhost:8080
python ./docvert-web.py [-p PORT]
View
2 core/docvert_libreoffice.py
@@ -65,7 +65,7 @@ def __init__(self, port=DEFAULT_LIBREOFFICE_PORT):
try:
context = resolver.resolve("uno:socket,host=localhost,port=%s;urp;StarOffice.ComponentContext" % port)
except NoConnectException, exception:
- raise Exception, "Failed to connect to LibreOffice.org on port %s. %s" % (port, exception)
+ raise Exception, "Failed to connect to LibreOffice on port %s. %s\nIf you don't have a server then read README for 'OPTIONAL LIBRARIES' to see how to set one up." % (port, exception)
self._desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
def convert_by_stream(self, data, format=LIBREOFFICE_OPEN_DOCUMENT):
View
BIN doc/sample/sample-document.doc
Binary file not shown.
View
BIN doc/sample/sample-document.odt
Binary file not shown.
View
BIN pipelines/tests/tables/table-span.doc
Binary file not shown.

0 comments on commit 0f58ec0

Please sign in to comment.
Something went wrong with that request. Please try again.