Reputation: 1
I am having ubuntu and have openoffice installed. Is there any way I can use php to convert my docs to odf? Is there any way to make php communicate with installed app?
Upvotes: 0
Views: 2389
Reputation: 129
Everything you need is PyODConverter (http://artofsolving.com/opensource/pyodconverter)
It is simple and fast way to convert documents using OpenOffice/LibreOffice via command line. You can pass the command from PHP using exec()
1) Start Openoffice on server as a service using libreoffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
. Change command "libreoffice" to "soffice" (for openoffice, if you have one).
2) Download DocumentConverter.py and use it like this: python DocumentConverter.py test.docx test.odf
And that's it.
Upvotes: 4