Convert eBooks in Linux

By | August 17, 2010

Say you just bought an Amazon Kindle or a Barnes and Noble Nook. You want to convert your eBook collection to .EPUB or .MOBI format. For this, install Calibre. The application not only provides you with a graphical way to manage your eBook collection, but also comes with a set of useful command-line tools. One of these is ebook-convert.
This tool can help you convert between tens of standard formats like EPUB, FB2, LIT, LRF, MOBI, OEB, PDB, PDF, PML, RB, RTF, TCR, TXT, HTML and more. Even CBR and CBZ (comic book formats) are supported.
The syntax is simple:

ebook-convert input_format output_format

For example, if you want to convert a comic book archive to something readable on an e-ink screen, use

ebook-convert filename.cbz filename.epub

or

ebook-convert filename.cbz filename.pdf

Not only will ebook-convert convert the file, but it will also trim the white spaces around the page so they will better fit the small screen of an electronic eBook reader.

14 thoughts on “Convert eBooks in Linux

  1. Pingback: Chestii de convertit e-book-uri in Linux

  2. T4L Post author

    I don’t have experience with DRM files and I personally stay away from those. I don’t know if those can be converted with ebook-convert but it might be so.

    Reply
  3. Morolandia

    Ok, but if you buy a Amazon Kindle’s book it has the DRM.
    From drm files i stay away too, it was only my curiosity.

    Reply
  4. T4L Post author

    After a little Google digging I found out you can remove DRM from Amazon Kindle?s files by using a set of Python scripts called MobiDeDRM.zip. Just google “MobiDeDRM.zip” and hit the first link. I’ll make a tutorial today on how to remove DRM from these files under Linux.

    Reply
  5. Pingback: Remove DRM from Amazon Kindle’s ebooks using Linux | Tips4Linux.com

  6. Pingback: Remove DRM from Amazon Kindle’s ebooks using Linux | Tips4Linux.com

  7. T4L Post author

    @Morolandia: I posted a new tutorial on the subject that interests you.

    Reply
  8. Pingback: Remove DRM from Amazon Kindle’s ebooks using Linux | tips & tricks

  9. Pingback: How To Convert Ebooks in Linux

  10. Pingback: Quickies: simple eBook format conversions « 0ddn1x: tricks with *nix

  11. Ken Jackson

    As a point of reference, it used to be illegal in the US to free another man’s slaves. That evil was corrected by eliminating slavery altogether.

    Of course, DRM isn’t as evil as slavery, but hopefully we will adopt the same solution, never the less.

    In any case, I’m delighted to hear about this project. But I doubt I’ll buy a Kindle anyway when there are freer alternatives.

    Reply
  12. Roger

    There’s a lot of crap on the net today, and your searching for how to convert files types to *.azw/*.mobi will likely return null.

    Native PDF files: Just got my Kindle DX with 9.7″ screen, and find most Linux published documents provide PDF versions. With turning the long screen sideways, the Kindle DX increases the font size another notch actually making most PDF’s readable! Downside, no clickable Table of Contents or Index. No notes or highlighting.

    Amazon’s kindlegen (AKA mobilegen): This is a free Linux binary only program provided by Amazon Publishing. It does an OK job at converting “.opf/.htm/.html/.epub” to “.azw/.mobi.” TABLE HTML tags are not supported and you will find missing text and text falling off the screen. (FIX: Make sure TABLE tag option BORDER=1?) I’ve seen the greatest success with converting .epub to .azw becuase the TABLE tags are likely already stripped unlike .html files.

    Amazons Online Free Conversion: Similar results as above, but also supports converting PDF to .azw/.mobi. Using .azi/.mobi is a lot lighter on CPU/Memory resources then PDF files. And, you can use notes and highlights within .azw/.mobi files.

    Calibre: OK if your stomach can tolerate QT bloat and all it’s 20+ dependencies. I find it provided a tad slightly better “any file” to .azw/.mobi — but likely the previous TABLE HTML tag bug will persist. (Used version calibre-0.8.12)

    My recommendation, use read the native PDF files for your techincal documents, or grab an .epub version and convert it to .azw/.mobi using kindlegen. (I have not tried .opf to .azw/.mobi yet.)

    Avoid using Calibre until Calibre can be compiled without the bloated QT dependencies if you just like using the command line tools. (I’m sure a lot of other dependencies are not needed during compile/runtime for it’s ebook-convert command line tool! Haven’t check yet though.)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *