I have a few thousand files, mostly PDF, many postscript, that I need to convert to several other formats. I can't use calibre (don't get me started) - I have considered writing scripts to dump pages to image files and using dubious cli programs to compile the images to these formats, but thought I would ask here before reinventing the wheel. Hopefully someone has an elegant solution. Epub is just zipped html with a specific file layout, the others ( djvu, mobi ) seem a bit different.
For highly structured pages with many pictures, IMHO, is the only usable format DjVu. So, use the DjvuLibre application library.
To move it you can use scripts in python-djvulibre. I think there are instructions in English. But surely there are Slavic instructions (Instruction in Czech 1, Instruction in Czech 2). If the community wanted to, I could translate the tutorial (PDF/TIFF/JPG -> DjVu) into English or automate the process with a script. (Some parts would need machine learning algorithms. For a full automated process.)
For pure text, use the method for creating EPUB format, which have already been referenced.
If you are not commercial, you can not use mobi format when you already have epub. Epub is IMHO a better format than mobi format. For electronic book readers, update your firmware and then you can read epub format.