Batch converting LibreOffice documents into pdf

LibreOffice has a nice command line interface which allows to convert documents into pdf.

For example to convert foo.odt document into foo.pdf use:

soffice -nologo -invisible-convert-to pdf foo.odt 

Use the -outdir parameter to specify the output directory

soffice -nologo -invisible-convert-to pdf -outdir ./pdf foo.odt 

Or to convert all documents from a directory use:

soffice -invisible -nologo -convert-to pdf *.odp 

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, He is the primary author of With more than one million visitors per month this website is one of the central sources for Java, Eclipse and Android programming information.
This entry was posted in Other and tagged . Bookmark the permalink.

3 Responses to Batch converting LibreOffice documents into pdf

  1. Ans says:

    thumbs up for simplicity;

  2. belg4mit says:

    Be careful copying & pasting, those options start with double dashes but have been converted to em dashes by the blog software.

    On Windows, there must be no running instances of OpenOffice/LibreOffice when this command is issued.

  3. belg4mit says:

    –headless is also easier and more effective than –nologo –invisible

Comments are closed.