enokson / Flickr

How to fix broken ebooks

Even when it’s against the law

Matthew Amster-Burton
4 min readMay 10, 2013

--

Earlier this year, I published my first ebook. In the course of researching it, I bought (and checked out from the public library) dozens of ebooks. Some were self-published, some from small publishers, and some from major publishers.

In the process, I had many of my preconceptions about self-publishing shattered. Sure, some of the self-published books were worth less than the $2.99 I paid for them. (And many of the big-label books were worth less than $10.) But many were terrific. And just as the writing quality of the books I read varied from awesome to terrible, so did the quality of the ebook formatting.

The overall quality of ebooks has improved considerably since the days when many were generated by scanning paper books. But it’s not good enough. When I pay money for a book, I expect it to be free of basic formatting errors. Here are some of the most common mistakes I see:

  1. Paragraph indents are too large, too small, or nonexistent. I paid $10 for one popular cookbook that turned out to lack paragraph indents, making it unreadable. I complained to Amazon and to the publisher. Nothing happened.
  2. Too much or too little space between paragraphs. If you’re not going to indent paragraphs, fine. Put a healthy chunk of space between them. That’s how Medium does it. But I often see books that take the belt-and-suspenders approach and use paragraph indents and between-paragraph spaces. It looks dumb and it’s hard to read.
  3. Too much or too little line spacing (aka leading).
  4. Misuse of hardcoded left and right indents for block quotes, title pages, and so on, indicating that the designer didn’t test on multiple platforms.
  5. No table of contents, or a broken table of contents with no links.

That’s the bad news. The good news is, an ebook is just HTML. When you get a bad one, you can fix it, and most fixes are easy. This is geek territory, but not uber-geek territory. My HTML and CSS skills are minimal, but I can usually make an ebook behave.

Fix your books

So let’s scrub in, grab our scalpels, and get to work. Here are the tools you’ll need.

  • DeDRM tools. For removing Digital Rights Management (DRM) from the ebook files. You can’t edit an ebook without removing the DRM. Stripping DRM from digital media for your personal use may or may not be legal where you live. I am not a lawyer. If the idea that it might be illegal for you to fix a defective product you purchased makes you mad, join the club. DeDRM can remove DRM from books purchased at all the popular ebook stores except iBooks.
  • Calibre. For converting ebook files between formats. This is only necessary if you want to get under the hood of a Kindle book; it’s not needed for books from iBooks, Kobo, and other stores that use the EPUB format.
  • Sigil. For editing EPUB files.

All of these tools are cross-platform and free.

Let’s say you buy a book from Amazon and it has too much space between paragraphs and a bad table of contents. Here’s how to fix that.

  1. Run DeDRM and select the book’s .azw file. You’ll produce a DRM-free .mobi file.
  2. Convert the .mobi file to EPUB using Calibre.
  3. Load the EPUB file in Sigil and find the CSS file. Edit it. For example, to remove before- and after-paragraph space:
p {
margin-top: 0px;
margin-bottom: 0px;
}

4. Save the file in Sigil and convert it back to MOBI (if desired) using Calibre. Transfer it to your reading device and enjoy.

Sigil can also generate an HTML table of contents that generally works well—certainly better than a nonexistent table of contents.

As you can see, I’m not going into any great detail on how to fix books. I assume you already know how to install software and massage HTML/CSS, or you wouldn’t have read this far. Really, I wanted to share this because I had an “aha!” moment when I realized that the same free tools I was using to create my own book could also be used to fix other books—or even just customize them to my preferences.

Limitations

  • When you edit an ebook, you lose the ability to sync it between devices. If you rely on Amazon’s Whispersync, for example, it only works for books downloaded directly from Amazon, not books you load onto your device manually.
  • Ebook CSS can get really hairy. You can often use Sigil’s “remove unused styles” feature to simplify a CSS file or use Calibre to consolidate multiple CSS files into one.
  • I don’t know of any current tools to strip DRM from iBooks purchases. However, some books (including my latest) are sold on iBooks without DRM.

--

--