Rss Feed Tweeter button Facebook button Technorati button Reddit button Linkedin button Webonews button Delicious button Digg button Flickr button Stumbleupon button Newsvine button

A Waage Blog

Ruby, Rails, Life

Archive for the ‘microsoft word to doc’ tag

OpenOffice Headless Mode Installation Word doc to pdf conversion

with 7 comments

How to set up OpenOffice to run in headless mode on Fedora 9

What we wanted was a system set up to convert any OpenOffice document to PDF. Most importantly, we needed to convert Word .doc files to .pdf, but in fact, any OpenOffice file types (.xls, .odt, .txt, .rtf, etc) will work, as long as you install the proper packages / dependencies!

Also important:
We will be starting OpenOffice in headless mode, which means no GUI. This should be started on boot up, and should just run in the background.

You don’t need to install all the OpenOffice packages if you don’t need them. We are mainly concerned with Word docs, so OoWriter is a must. We are running in headless mode, which means we don’t have a GUI to openoffice. So we can leave out a bunch of unnecessary packages.

- Here’s what we have installed:  1:2.4.2-18.3.fc9 installed 1:2.4.2-18.3.fc9 installed 1:2.4.2-18.3.fc9 installed 1:2.4.2-18.3.fc9 installed 1:2.4.2-18.3.fc9 installed 0.5-2.fc9 installed

If you need to convert Excel spreadsheets, ppt Powerpoint presentations to pdf, you will need to install the corresponding package (ie.,, etc.)

After you have these packages installed, be sure you have the soffice command. By default it is here:

Next, try to start up the service with this command:

$ /usr/lib64/ -headless accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard &

#Note: the ampersand (&) allows the command to run in background so you get your shell back.
You can specify whichever port you would like. The -nofirststartwizard flag does exactly that.

Next step is to find a script (client) that can interact with this OpenOffice service.
A few options are:
1. dag’s unoconv (Available from yum)
2. PyODConverter – a cool Python script to do conversions
3. Write your own!

We chose to use PyODConverter. It’s simple to use:

$ example.doc example.pdf

Lastly, I mentioned that we want this soffice to start up everytime we reboot.

Simply add the line to your /etc/rc.d/rc.local

# Start up openoffice for fax conversion
$ /usr/lib64/ -headless accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard

And there you have it. Hope that helps somebody. Happy Conversions!

Hint: If you are getting strange unintelligible errors about “URL seems to be an unsupported one”, it may be that you have not installed a necessary openoffice package. That’s how I discovered I needed OoWriter …

Written by Andrew Waage

September 17th, 2009 at 2:30 pm