Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is needed to batch convert a set of .doc or .docx files to .pdf in terminal, not using a GUI. Should this be done using a single file versus a group.

I would also like to maintain as much meta-data as possible

share|improve this question
duplicate - superuser.com/questions/156189/… –  bodhi.zazen Mar 17 '12 at 15:49
The best answer there is to install another application and use a "pdf printer". What is wrong using a CLI method or will I loose the meta-data –  Ringtail Mar 17 '12 at 15:55
I didn't say there was anything wrong with oowriter, gscan2pdf or any other GUI method. I was looking for the CLI then I intend to incorporate it into the .bashrc so I could pdf ~/some_.docx, thats all. Thanks for the suggestion. –  Ringtail Mar 17 '12 at 16:12
See also this answer. –  Takkat Mar 17 '12 at 18:47
@Takkat - That answer gets it into duplicate zone for me. –  hbdgaf Mar 17 '12 at 19:53

3 Answers 3

up vote 10 down vote accepted

lowriter can be used as a command line tool (lowriter is a part of LibreOffice)

lowriter --convert-to pdf *.doc
convert /home/bodhi/Documents/testdoc2.doc -> /home/bodhi/Documents/testdoc2.pdf using writer_pdf_Export
convert /home/bodhi/Documents/testdoc.doc -> /home/bodhi/Documents/testdoc.pdf using writer_pdf_Export

evince testdoc.pdf

I do not have windows, so testdoc download from here


share|improve this answer
libreofice throws errors using this method, complains of not finding /home/user/documents/test.docx blah –  Ringtail Mar 20 '12 at 1:00
what command did you use ? Do you have a test.docx ? –  bodhi.zazen Mar 20 '12 at 4:06
lowriter --convert-to pdf /home/user/Documents/Document compatibility check.docx –  Ringtail Mar 20 '12 at 4:35
Works perfect for me! Beware of using "space" character from command line... When you get to the space character simply press "tab" ;) –  Pitto Nov 16 '12 at 13:11
lowriter does not convert docx files correctly. At least not always. –  Sceptical Jule Dec 26 '13 at 19:56

Translation: I use unoconv, which converts all formats supported by LibreOffice.

Original: Eu uso o unoconv, converte todos os formatos suportados pelo LibreOffice.

share|improve this answer

If you have Libre Office write you can directly click on File->Export as PDF

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.