I'm trying to convert documents from html,txt to pdf,odt and vice versa.. But only odt to pdf seems to work.. No other file formats are converted
Here are my commands
libreoffice --headless --convert-to pdf test.html [Not working]
libreoffice --headless --convert-to odt test.html [Not working]
libreoffice --headless --convert-to pdf test.docx [Not working]
libreoffice --headless --convert-to pdf test.odt [Working]
For me, the following two packages were the minimum needed to get headless docx to pdf conversion working on CentOS 7 :
This worked for me on LibreOffice 4.2 / Linux:
Credit: http://ask.libreoffice.org/en/question/14130/how-do-i-install-filters-for-the-soffice-command/
For me. The problem I had was that --headless does not work, AT ALL (just returns in 15 milli-seconds), if a local libreoffice process already has the document open.
Make sure you only do headless operations on a document that is NOT already open in LibreOffice.
The real problem is that the libreoffice/soffice command line doesn't provide any error message or debugging information, so it's all guesswork. If you are up to it, then try strace for hints.
In my case (Linux), I didn't have the correct packages installed - for example, to convert spreadsheets, libreoffice-calc is needed (duh), and also libreoffice-headless (double-duh). But the command line won't tell you that - it just hangs, or runs and doesn't do anything.