Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to convert libreoffice ODT to PDF in bash

I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
by

1 Answer

Bharatgxwzm
One possible approach is to install unoconv (if not already installed) and
unoconv file.odt

Please see man unoconv for details
unoconv is a command line utility that can convert any file format that LibreOffice can import, to any file format that LibreOffice is capable of exporting. unoconv uses the LibreOffice’s UNO bindings for non-interactive conversion....
In some platforms it is also necessary to install libreoffice-headless

Login / Signup to Answer the Question.