I have a set of files in .doc format, that need to be converted to .pdf format. I am using Ubuntu linux.
10 Answers
Alternative 1)
sudo apt-get install cups-pdf
Then navigate to System > Administration > Printing and create a new printer, set it as a PDF file printer, and name it as "pdf".
Then run:
oowriter -pt pdf your_word_file.doc
Now you'll find your .pdf file in ~/PDF.
Alternative 2)
sudo apt-get install wv tetex-extra ghostscript
wvPDF test.doc test.pdf
If the tetex-extra package is not available with your distribution, try texlive-base plus texlive-latex-base:
sudo apt-get install wv texlive-base texlive-latex-base ghostscript
wvPDF test.doc test.pdf
- 55,953
You can use:
oowriter -convert-to pdf:writer_pdf_Export doc_file.doc
- 19,080
- 141
If you're running X then you can do it through Open Office. Since you're about to object to doing it manually, remember there's some nice macro scripts in Open Office so you can automate it. You can do something similar with AbiWord (AbiWord --to=pdf).
If you've not got X then there is antiword, but that just extracts the text - doesn't do any formatting or graphics. There's also wvWare which I've used to bulk extract images from doc files, but I've never tried using it to convert doc files to pdfs.
Oh and .docx files may well need something different, but since they're just zipped xml files it shouldn't be too difficult to do something useful with them. For bulk extracting images you just unzip them and copy the images directory, but I've never needed to convert them in Linux.
- 469
I would try using for Linux
$ /opt/openoffice.org3.1/program/python DocumentConverter.py test.odt test.pdf
For windows:
"C:\Program Files\OpenOffice.org 3.1\program\python" DocumentConverter.py test.odt test.pdf
PyODConverter requires OpenOffice.org to be running as a service and listening on port (by default) 8100; the simplest way to start OpenOffice.org as a service is from the command line:
"C:\Program Files\OpenOffice.org 3.1\program\soffice" -accept="socket,port=8100;urp;"
Open Office is a good way forward, but the conversion fidelity is not always quite right.
If you are after a 100% Linux solution then that is the best way forward. However, if you don't mind a single Windows Box and write a little bit of code to interface with it from your Linux system then have a look at this post.
I wrote this post so the usual disclaimers apply.
- 480
- Open -> Open Office (3.2 in my case)
- Open Document you want to export
- File->Export as PDF
- Press: Export
- Choose file name
Done and Done
- 11
- Install OSE VirtualBox from the software center
- Install Windows inside VirtualBox
- Install MS Office in the virtual Windows
- Install
dopdfin the virtual Windows - Set
dopdfas your default printer during the installation. - Open the
*.docin the virtual Office and print it to thedopdfvirtual printer. - The
*.pdffile will appear in theMy Documentsfolder of the virtual Windows - Send it as email attachment to wherever you need to send it.