Converting PDFs to EPUB and MOBI Formatted E-Books

Derek Timmerman

Category: Development

06.27.2012

Here in the NJI Media development shop, we wear many hats. From web apps to interactive dashboards, we stay sharp in a wide spectrum of digital skills. A 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. If you want to make your publications accessible as e-books, these are the two formats you’ll want to use.

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 one file; rather, it’s a package of files. At its 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 (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 recommended.

Documents of the .mobi format do not offer the same editing flexibility as .epub files. This is a non-issue, though, since we recommend any conversion to .mobi go use .epub as the 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 use, 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’re ready to begin. Follow along with our six-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 that won’t translate well in conversion. Look for:
    • Multi-column layouts. These don’t gel with Calibre (or any 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. 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, 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 will show at least two choices now: .epub and .pdf. Click .epub (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 happens next? How to convert from .epub to .mobi

Fire up your converted document in your reader of choice (Calibre is capable of converting and 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 direct creation and 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.




    We use cookies on this site to enhance your user experience. By clicking accept you agree to our privacy policy.