Welcome, Guest. Please login or register.

Login with username, password and session length
May 20, 2012, 05:07:10 AM
[Less]
  • News: We have moved our site to a new web hosting provider. Report any bugs!

  •  
linktree ATokar.net  >  Development  >  Online Tools
linktree Topic: DOCX to ODF converter
Pages: [1]   Go Down
  Print  
Author Topic: DOCX to ODF converter  (Read 1688 times) Rating: *****
0 Members and 1 Guest are viewing this topic. Bookmarked by 0 members.
Nightowl
Karma: +1/-0
Offline Offline

Posts: 7



« on: March 18, 2009, 07:20:10 AM »

If you're like me, then you receive .docx, MS Word 2007 files every once in a while. If you're like me, then you dislike emailing back asking the person who sent the .docx file to you to re-send it to you as a .doc or other format. Or, perhaps you're stuck with using a file conversion service such as zamzar, which sometimes takes a few hours to send you the result during active times of the day.

Fine, so, what can you do about it? . . .

Depends. If you use Windows as your primary operating system, and have an older version of MS Word, such as 2003, then there's a Microsoft plugin for that.

But, if you use OpenOffice on Windows or Linux, then things are a little trickier. On windows, you've got some options. On linux, however, you've got Odfconvert.

There's a good howto available on how to do this. However, I'll paraphrase them into here for simplicity. ;)

This is done on an amd64 Debian Sid installation, FYI. The process for other distros is similar.

First, download either the x86 or amd64/x86_64 file.

Yes, yes, I know they're rpm archives. That's not a problem, however . . .

While those are downloading, as root (or using sudo if you're a Ubuntu user), run apt-get install rpm libgif4 cpio. Yeah, I know cpio is installed by default. Good practice to include all used utilities. ;)

Wait for the above two to complete. (Note that most of you won't have any problems here. Your internet connections can probably handle a 6MB download in a few moments. Mine, however, can't . . .)

Change to the directory where you downloaded the .rpm to and create a temporary directory . . .
Code: [Select]

cd ~/downloads
mkdir -p /tmp/odfconvert
cp odf-converter*.rpm /tmp/odfconvert
cd /tmp/odfconvert

Good. Now, extract the archive . . .
Code: [Select]

rpm2cpio odf-converter* |cpio -ivd

Now (as root or with sudo for you ubuntu people), copy the executable into /usr/bin, where you'll probably want it. If you don't have root access, then simply replace /usr/bin with ~/bin/.
Code: [Select]

cp usr/lib/ooo-2.0/program/OdfConverter /usr/bin/

If you're like me, you'll need a symlink for libtiff.so.3 . . . (this requires root access or sudo access. If you don't have root access, consider creating a wrapper script that sets LD_LIBRARY_PATH and create a symlink yourself.)
Code: [Select]

cd /usr/lib
ln -s libtiff.so.4 libtiff.so.3
cd -

Clean up after yourself . . .
Code: [Select]

cd ..
rm -rf odfconvert

Now, to test it!
Code: [Select]

cd ~/downloads
OdfConverter /i thedocxfiletoconvert.docx


Wait a moment or two, and . . .

Wait, what's this? A .odt file! It can't be!

It gets better! You can additionally convert .odt *back into .docx*. If you need to do this, just give OdfConverter a .odt file ;)
« Last Edit: April 17, 2009, 04:26:40 PM by Nightowl » Logged
Nobbit
Global Moderator
Karma: +4/-0
Offline Offline

Gender: Male
Posts: 148




« Reply #1 on: April 17, 2009, 10:58:15 AM »

In case you get stuck here

Quote
Now (as root or with sudo for you ubuntu people), copy the executable into /usr/bin, where you'll probably want it. If you don't have root access, then simply replace /usr/bin with ~/bin/.

Code: [Select]
cp usr/lib/ooo-2.0/program/Odfconverter /usr/bin/


it might depend on the fact, that the Terminal is case-sensitiv, so change the "c" in Odfconverter to a capital "C":

Code: [Select]
cp usr/lib/ooo-2.0/program/OdfConverter /usr/bin/


It will work fine then.
Logged

And after they killed the Hobbit, it went even worse 'cause there appeared ... the Nobbit
Cleo
Administrator
Developer
Karma: +6/-0
Offline Offline

Gender: Male
Posts: 172




WWW
« Reply #2 on: April 17, 2009, 12:50:46 PM »

It's not the terminal that is case sensitive, it's the file system. :D

Guess Nightowl made a tpyo.
Logged

Nightowl
Karma: +1/-0
Offline Offline

Posts: 7



« Reply #3 on: April 17, 2009, 04:26:07 PM »

That you are correct . . . my bad. I typed that all out without trying it . . . #1 thing not to do when posting a HOWTO. :P

I'll edit the original.
Logged
Nobbit
Global Moderator
Karma: +4/-0
Offline Offline

Gender: Male
Posts: 148




« Reply #4 on: April 17, 2009, 06:38:29 PM »

I learn a lot from the high-teacher here! How would I know WHAT is case sensitive - but in the end: It works in practice, theory doesn't matter (I always wanted to say that, cause most of the time it is me who has to hear this :P)
Logged

And after they killed the Hobbit, it went even worse 'cause there appeared ... the Nobbit
Nightowl
Karma: +1/-0
Offline Offline

Posts: 7



« Reply #5 on: April 20, 2009, 08:05:42 PM »

Though, linux will sometimes handle non-case-sensitive filesystems (like vfat, ntfs) as case-sensitive, as well. The vfat driver will output a message like . . .

Code: [Select]

Apr 11 23:59:37 ginkgo kernel: [126518.230847] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!


 . . . when, (like me) you use UTF-8.

Makes for some confusion amongst ported programs, sometimes . . .

In any case, I do hope that being able to convert DOCXes to ODFs will help you in some way . . . I had fairly major problems, since I was being sent a few dozen .DOCXes at a time. ;)
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Copyright © 2007–2010 ATokar.net. All trademarks are property of their respective owners.
Powered by SMF | SMF © 2006–2007, Simple Machines LLC
Page created in 0.109 seconds with 28 queries.
Contact Us - ATokar.net - XML - Sitemap - Top
Valid HTML 4.01! Valid CSS! Valid RSS! Powered by Linux Powered by MySQL Powered by PHP Powered by Apache 2.2