View Single Post
Old 04-28-2009, 06:52 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're in luck, the new calibre conversion framework has support for two conversion paths:

1) input format -> html -> output format

2) input format -> sequence of images -> output format

(2) is already being used for conversion of comics (.cbr and .cbz). It can be used for image based converters of PDF and DJVU as well.

The first step is getting the new code running. You can check out the code using the command (in a unix OS)

bzr branch lp:~kovid/calibre/pluginize

Then run

python setup.py build
python setup.py develop

Now you can use the

ebook-convert input-ebook output-ebook

command to run the new conversion pipeline. Take a look at the python module calibre.ebooks.comic.input to see how to write an input plugin for an image based format. There is already a plugin for PDF, you can add options to it so that the user can select image based conversion instead of the default HTML based conversion.

If you need more help you can ask in the #calibre IRC channel on freenode, mail to the calibre-devs mailling list or just post here.
kovidgoyal is online now   Reply With Quote