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.
|