5 Answers
Reset to default
42
lowriter can be used as a command line tool (lowriter is a part of LibreOffice)
lowriter --convert-to pdf *.docconvert /home/bodhi/Documents/testdoc2.doc -> /home/bodhi/Documents/testdoc2.pdf using writer_pdf_Exportconvert /home/bodhi/Documents/testdoc.doc -> /home/bodhi/Documents/testdoc.pdf using writer_pdf_Exportevince testdoc.pdfI do not have windows, so testdoc download from here
www.mltweb.com/prof/testdoc.doc
Improve this answer
edited Mar 18, 2012 at 17:30
answered Mar 17, 2012 at 19:49
PantherPanther
105k1919 gold badges202202 silver badges291291 bronze badges
9
-
libreofice throws errors using this method, complains of not finding /home/user/documents/test.docx blah
–Ringtail
Commented Mar 20, 2012 at 1:00
-
what command did you use ? Do you have a test.docx ?
–Panther
Commented Mar 20, 2012 at 4:06
-
1
Works perfect for me! Beware of using "space" character from command line... When you get to the space character simply press "tab" ;)
–Pitto
Commented Nov 16, 2012 at 13:11
-
2
lowriter does not convert docx files correctly. At least not always.
–Sceptical Jule
Commented Dec 26, 2013 at 19:56
-
1
When I first tried your suggested
lowritercommand on Ubuntu 12.04, it opened a splash window and froze. I killed it with C-c and tried again without aDISPLAYvariable. This time it first printed an error about missing display, but convert the document without any problems. Is it expected behavior, that the command can only work without aDISPLAYenvironment variable?–kasperd
Commented May 30, 2014 at 10:35
| Show 4 more comments
9
I use unoconv, which converts all formats supported by LibreOffice.
Improve this answer
edited Sep 22, 2016 at 7:27
CommunityBot
1
answered Aug 28, 2012 at 20:58
Francisco DreyfussFrancisco Dreyfuss
9111 silver badge11 bronze badge
1
-
2
Just for the record:
$ unoconv myfile.docx(it createsmyfile.pdf)–tokland
Commented May 9, 2017 at 10:09
Add a comment |
6
I use the following script:
for f in *.docdolowriter --headless --convert-to pdf "$f"done--headless will prevent Libreoffice from opening 100s of files and eventually crashing if you try this with directories containing a lot of .doc files
Improve this answer
edited Oct 29, 2015 at 16:23
answered Oct 29, 2015 at 11:45
BruniBruni
11.2k99 gold badges6666 silver badges108108 bronze badges
3
-
this is the best, works for multiple files
–Bas Lamerichs
Commented Oct 29, 2020 at 17:55
-
1
i believe the same can be done in one line:
lowriter --headless --convert-to pdf *.doc. yeah, kudos to @Matin below ;)–diabolusss
Commented Sep 24, 2024 at 11:34
-
@diabolusss You are right. To my defense, I answered 8 years earlier ;-)
–Bruni
Commented Sep 27, 2024 at 12:39
Add a comment |
1
You can also open that folder where you have all the .doc or .docx files and right click.Then select open terminal here. then type lowriter --convert-to pdf *.doc
Improve this answer
answered Jul 15, 2023 at 5:48
MatinMatin
54511 gold badge55 silver badges1111 bronze badges
Add a comment |
In my opinion, the best way is with unoconv.
First install the package:
sudo apt install unoconvand then convert to pdf using this command:
unoconv -f pdf XXYY.docx(Replace XXYY.docx with the name of your file.)
Improve this answer
edited Oct 17, 2018 at 8:07
Zanna♦
72.4k6060 gold badges227227 silver badges331331 bronze badges
answered Oct 17, 2018 at 7:30
user882893user882893
1
2
-
Reasons why you would choose unoconv over other options?
–gatorback
Commented Apr 15, 2019 at 10:50
-
Add a comment |
You must log in to answer this question.
Start asking to get answers
Find the answer to your question by asking.
Ask question
Explore related questions
- command-line
- batch
See similar questions with these tags.