LibreOffice – Batch convert files to PDF

LibreOffice supports PDF conversion. What you need to do is to open the document in LibreOffice and click the Export as PDF… option under the file menu list. It’s good and simple to convert a single document but quite tedious if you have more files.

For batch conversion, we need to make use of the LibreOffice command in terminal.

1. Go to the directory which contains the source files.
 

2. Execute the following command to convert ALL files which ends with .odt into .pdf.

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


 

If you are using Mac OS X, by default the command is not included in the bin path and it doesn’t work even if you have created a symbolic link in the /usr/local/bin folder since there is a file path dependency. A simple work around is to provide a full path the binary.

/Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --nologo --convert-to pdf *.odt

 

Done =)

Reference:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s