Converting PDFs to EPUB and MOBI Format E-books

Derek Timmerman

Category: Development

06.26.2012

Here in the NJI development shop, we wear many hats. From web apps to interactive dashboards, we stay sharp in a wide spectrum of digital skills. Another little known segment of our skill-set is digital publishing: the process of taking a regular document (such as an InDesign file or a PDF) and transforming it into a e-book.

This week, the dev shop would like to share some of that knowledge with you. In this post, we’ll walk you through the process of converting PDF files into EPUB and MOBI files, making them accessible on devices such as Kindles, Nooks, and iPads.

What is an .epub file? What is a .mobi file?

In the digital publishing industry, the .epub and .mobi formats reign supreme. If you own any sort of e-reading device, the files stored in it will be in one of these two formats. So, if you have a desire to make your publications accessible as e-books, these are the two formats you’ll want to be converting to.

The .epub format is supported by iOS (via the iBooks app), Nook (both the device and the desktop application), most mobile OS e-book apps (such as Bluefire Reader for iOS, or Aldiko Book Reader for Android), and many other common e-reader devices (such as the Sony Reader).

The beauty of an .epub file is that it’s not actually one file, but rather, is a package of files. At it’s core, an .epub contains a markup document (written in XHTML standards), a CSS stylesheet, several descriptive metadata documents (two XML files and an .opf file), and asset directories for images and fonts. This means that post-conversion, you retain the ability to get under the hood and manually correct irregularities and mistakes.

The .mobi format is supported by Kindle (both the device, the desktop application, and the mobile apps). Although .mobi files are not as widely supported as .epub files, they are the primary file format for the Kindle, so .mobi conversion is still recommended.

Documents of the .mobi format do not offer the same editing flexibility that .epub files have. This is a non-issue though, since we recommend any conversion to .mobi go through .epub as it’s source. Presentation is fairly congruent between the two formats, so getting it right in .epub means getting it right in .mobi.

Regardless of which e-book formats you convert to, they all share one key attribute that makes them more valuable to e-reader owners than simple PDFS – they have reflowable text.

Converting your PDF to an EPUB or MOBI File:

Before beginning, you’ll need Calibre. Calibre is a free, open-source e-book utility, used for both managing e-book libraries and converting documents between e-book formats. Calibre can be downloaded and installed on Windows, Mac OS X, and Linux operating systems.

Once you’ve finished installing Calibre, you’ll be ready to begin. Follow along with our 5-step tutorial, and your e-book will soon be accessible to the tablet-toting masses.

  1. Begin by preparing the source document for conversion. Examine the document for stylistic formatting which won’t translate well in conversion. One should look for:
    • Multi-column layouts. These don’t gel with Calibre (or with other conversion software, for that matter). When the conversion software takes text from the source document, it does so from left to right, without regard for columns. So, when it comes to a column gutter, it doesn’t skip to the next line in the same column – it skips to the same line in the next column.
      Avoid converting multi-column documents, unless you have access to the source file (such as an Adobe InDesign .indd file), or are willing to manually sift through the generated XHTML within the .epub and correct it by hand.
    • Rasterized text. Avoid rasterizing text. Rasterized text might appear in the form of a photograph caption or a chart annotation. Replace rasterized text images with vector text.
    • Large image assets. EPUB files have a hard limit on file sizes; they cannot include anything larger than 260kb. If access to the source document is available, it’s best to compress image assets prior to conversion.
  2. Power up Calibre and add in the source document by dragging and dropping it into the center of the Library window.
  3. Right-click the newly added document and select the option that reads “Convert individually”. You’ll immediately be taken to a modal window titled “Convert document-name“.
  4. Adjust your settings. Find the following settings and change as indicated:
    • Output Format: change to EPUB (this dropdown is located at the top right of the window).
    • Look and Feel tab: change Minimum Line Height from 120% to 100%.
    • Page Setup tab: change Output Profile to Default Output Profile. Change Input Profile to “Default Input Profile”.
  5. Click OK to begin conversion. You’ll be taken back to the main Calibre screen. To follow the progress of your conversion job, click on the bottom right of the screen (which will now read Jobs: 1). This process should take about 10-20 seconds for smaller documents, and up to 2 minutes for larger documents.
  6. Once your conversion job has finished, grab a copy of the finished document. On the left hand side of the main screen, click on the Formats dropdown. It should have at least two choices now: EPUB and PDF. Click EPUB, and a green plus sign will appear next to it. Now, your library will only show EPUB files. In the list of filtered documents, drag and drop your converted document from Calibre to your desktop. And, BOOM! You’re done. Congrats.

What next?

Fire up your converted document in your reader of choice (Calibre is capable of not only converting, but also reading, e-book files) and examine the fruits of your labor. Once you’ve had a second to recover from your newfound technical awesomeness, repeat the process, this time with EPUB as your input, and MOBI as your output. If you’ve followed these steps and settings, you now have a cross-device compatible e-book, ready for sharing.

We should mention that this isn’t the only way of creating e-books. Our digital publishing process skews more towards InDesign and directly creation/manipulation of the markup within the EPUB file itself. However, for convenience and accessibility, this method is incredibly effective, and we hope you put it to good use.

fortune favors

the bold

We collaborate with tenacious organizations and ambitious people.

    To help personalize content, tailor and measure ads, and provide a safer experience, we use cookies. By clicking or navigating the site, you agree to allow our collection of information on and off NJI through cookies. Learn more, including about available controls: privacy policy.