Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to convert an ODT file (LibreOffice) to PDF?

share|improve this question
Related (but not a duplicate!): How to convert pdf file to an odt file? – Eliah Kagan Jan 11 '13 at 19:15
up vote 43 down vote accepted

Just open the document with libre office and choose Export as PDF...:

enter image description here

For a command line solution there is unoconv Install NAME that converts files from the command line:

unoconv -f pdf mydocument.odt

Note: Only starting from Ubuntu 11.10 unoconv depends on Libre Office. Previous unoconv versions (from Ubuntu <= 11.04) depend on Open Office (but it will also run with Libre Office).

share|improve this answer
thx for mentioning unoconv, it's great! – Boris Däppen Oct 6 '15 at 14:58

You can also use the command-line of libreoffice for your purpose. That gives you the advantage of batch conversion. But single files are also possible. This example converts all ODT files in the current directory to PDF:

libreoffice --headless --convert-to pdf *.odt

Get more information on command-line options with:

man libreoffice

(Note: Due to bug 37531, you have to close all running instances of LibreOffice before this command will work.)

share|improve this answer
Another argument for command line usage is that for instance in my case the gui has all of a sudden started producing flawed pdf's, but the command line still works like a charm. – Hermann Ingjaldsson Feb 27 '13 at 14:16
Thi9s works, but it has a problem: if the GUI is open the command will do nothing (not even show an error). Ugly, but with this workaround you can open a new instance: --env:UserInstallation=file:///path/to/some/directory. – tokland Sep 16 '13 at 13:14
@tokland: There's a bug report for that: – Mechanical snail Dec 2 '13 at 2:02

Nautilus Script

This script utilizes libreoffice to convert files compatible with LibreOffice to PDF.

## PDFconvert 0.1
## by Glutanimate (
## License: GPL 3.0
## depends on python, libreoffice
## Note: if you are using a non-default LO version (e.g. because you installed it 
## from a precompiled package instead of the official repos) you might have to change
## 'libreoffice' according to the version you're using, e.g. 'libreoffice3.6'

# Get work directory
base="`python -c 'import gio,sys; print(gio.File(sys.argv[1]).get_path())' $NAUTILUS_SCRIPT_CURRENT_URI`"

#Convert documents
while [ $# -gt 0 ]; do
    libreoffice --headless --invisible --convert-to pdf --outdir "$base" "$document" 


For installation instructions see here: How can I install a Nautilus script?

share|improve this answer
I just hope that such function as "lipreoffice" would be in OSX too. Sometimes, I feel my hands so short when I have to use Mac. – Masi Mar 6 '13 at 18:31

Note: I decided to delete my answer from this question and to post a modified version of it here when I realised that unoconv doesn't deal with psw files at all well, and doesn't convert them successfully to other formats. There may also be problems with docx and xlsx formats.

However, Libreoffice fully supports many file types; full documentation is available at the official site, which details the valid input and output formats.

You could use the command-line libreoffice convert utility or unoconv, which is available in the repositories. I find unoconv to be very useful, and it is probably what you want. Even though Takkat has briefly mentioned unoconv, I thought it would be useful to give some more details and a batch conversion one-liner.

Using the terminal you could cd to the directory containing your files and then batch convert all of them by running a one-liner like this:

for f in *.odt; do unoconv -f pdf "${f/%pdf/odt}"; done

(This one-liner is a modification of my translate script featured in this answer.)

If you later want to use any other file formats, just substitute the odt and pdf for any other supported input and output formats. You can find the supported formats for a file type by entering unoconv -f odt --show. To convert a single file use, for example, unoconv -f pdf myfile.odt.

Further information on and options for the program can be found by entering in terminal man unoconv or by going to the Ubuntu manpages online.

share|improve this answer

Consider using the docspal service ( It is free, fast and supports lots of formats. Hope, it will be useful for you.

share|improve this answer

Another Nautilus Script

This very simple and lightweight Nautilus Script uses unoconv to convert selected file(s) compatible with LibreOffice to PDF format:

#Nautilus Script to convert selected LibreOffice-compatible file(s) to PDF
for filename in $@; do
unoconv --doctype=document --format=pdf "$filename"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.