I have a set of files in .doc format, that need to be converted to .pdf format. I am using Ubuntu linux.
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".
oowriter -pt pdf your_word_file.doc
Now you'll find your .pdf file in ~/PDF.
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
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.
You can also do it with AbiWord:
sudo apt-get install abiword
Then you can load .doc files in AbiWord's GUI and export to PDF, or from the commandline:
abiword --to=pdf filename.doc
I would try using for Linux
$ /opt/openoffice.org3.1/program/python DocumentConverter.py test.odt test.pdf
"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.
- Install OSE VirtualBox from the software center
- Install Windows inside VirtualBox
- Install MS Office in the virtual Windows
dopdfin the virtual Windows
dopdfas your default printer during the installation.
- Open the
*.docin the virtual Office and print it to the
My Documentsfolder of the virtual Windows
- Send it as email attachment to wherever you need to send it.