Tuesday, May 06, 2008

Open docx with OpenOffice 2.3 in Ubuntu Gutsy (7.10) 64-bit

The easiest way to open docx under OpenOffice in Ubuntu is to run Hardy and OpenOffice 2.4, which has native support. For those of us who can't upgrade yet, here's how I did it.

This site shows you how to do it, but it's incomplete and outdated a little.

First, grab the latest (as of today) odf converter. You might want to visit the oooninja site to get the appropriate package for your architecture.

wget http://download.go-oo.org/red-carpet/ooo-680/sled-10-sp-x86_64/odf-converter-1.1-7.x86_64.rpm

Now we install alien.

sudo apt-get install alien

Some sites recommend that you install libgif4, but this requires libungif4g and that breaks a whole bunch of things. I recommend that you stick with libungif4g since it works and doesn't break things.

OK, we're to the point that we can start the fun stuff. After we unpack it, we need to copy over 3 files from the odf-converter package. Change directory to where you downloaded the package and do this:

sudo alien --to-tgz --script odf-converter-1.1-7.x86_64.rpm
mkdir odf-converter
cd odf-converter
tar -xzf ../odf-converter-1.1.tgz
sudo cp usr/lib64/ooo-2.0/program/OdfConverter /usr/lib/openoffice/program/
sudo cp usr/lib64/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Filter/MOOXFilter_cpp.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Filter/
sudo cp usr/lib64/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Types/MOOXTypeDetection.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Types

Almost there...you can try to open a docx at this point, but for me it required one more step. It wants libtiff3, but only libtiff4 is installable. Fortunately, we can fake it.

cd /usr/lib
sudo ln -s libtiff.so.4.2.1 libtiff.so.3
cd -

You should now be able to open those nasty, proprietary documents you get from your boss. Cheers!


No comments: