booksonthemove
02-17-2010, 04:51 PM
I know that under ms-windows that calibre can convert doc to other file types via Word. Koffice has the same functionality. How would one make calibre talk to Koffice so that one-button doc conversion can be had under linux? Is it just an issue of calling Koffice with options via python or is it a lot more complex?
kovidgoyal
02-17-2010, 04:57 PM
calibre doesn't convert doc on windows either. But it should be relatively easy to make a custom input format plugin that uses another program to convert doc to html first.
frabjous
02-17-2010, 10:50 PM
I don't know how easy it would be to do this with KOffice, but using AbiWord (http://abisource.org), I've got a very simple bash script set up to do conversion from .doc to .html (with AbiWord) and from .html to whatever (with calibre's commandline).
E.g. save this as
~/bin/docconvert.sh
#!/bin/bash
filein="$1"
fileout="$2"
abiword --to=html $filein
ebook-convert ${filein%.doc}.html $fileout
Then from the command-line, something like:
docconvert.sh myfile.doc myfile.epub
will convert from .doc to epub.
This could of course be improved a zillion different ways, and can of course, be one of the associated applications for .doc files in nautilus to skip having to open a terminal.
booksonthemove
02-18-2010, 07:25 AM
excellent, many thanks. Didn't twig that abiword can do this
kiklop74
02-18-2010, 09:29 AM
For a command line conversion of Word documents prior to docx you can use antiword
http://www.winfield.demon.nl/
frabjous
02-18-2010, 03:19 PM
If it wasn't clear, AbiWord can do .docx from the commandline too. You may need to tweak the script above for it, though.
booksonthemove
02-21-2010, 06:55 AM
thanks for the tips guys. been a long while since I used antiword ;)
grimborg
03-25-2010, 07:06 AM
I use "antiword -x db" to convert to docbook, then db2epub to convert to epub and then ebook-convert to convert to lrf. You lose all images but most of the format and the chapter structure stays. Sweet and easy!
frabjous
03-25-2010, 12:50 PM
You lose all images ...
I'm afraid that would be a deal breaker to me.