Hashemian Blog
Web, Finance, Technology

My EPUB Journey - A Sort of EPUB Primer

    📂 Technology,Web,Writing     # , , ,     🗨 No Comments

With the proliferation of the mobile devices, books have morphed into digital versions and are increasingly viewed in their digital rather then paper formats. To that end there are several popular formats for e- books. PDF, the well-established type from Adobe has been around for many years and still widely used for digital books, but newer formats have begun to supplant PDF as they are more suited to mobile devices. Of those, the most popular is ePub, used by almost all modern e-book readers, except for Amazon Kindle, which uses the KF8 or AZW formats.

With ePub content is optimized and can easily reflow as the user zooms in and out, making for a much smoother reading experience, regardless of the device . In a previous post I mentioned that iUniverse had uploaded my book to Google Books (now part of Google Play) along with its ePub version and how I was able to stop that. In doing so, iUniverse had managed to knock out my own upload from Google Books which I had done long before. I already had the PDF version of my book, so re-uploading that format was a simple task. Generating the ePub version to upload wasn't so simple, specially since I wanted to do that at no cost.

The first order of business was to get an ePub reader on my computer. To that end I followed Google's suggestion of installing Adobe Digital Editions. The product can be used to read eBooks and it has a library feature where one can create a collection of eBooks. Another product, Calibre, does the same and can handle other formats such as PDF and it has other features such as format conversion.

Adobe Digital Editions

Adobe Digital Editions

My first inclination to create the ePub version was to convert the PDF file of the book I already had. One of  the promising methods that I found was an add-on for OpenOffice. After installing OpenOffice and subsequently the add-on, I started the conversion and waited and waited and waited. After a couple of hours the process ended and I had a giant ePub file to contend with. When I tried to view the file in either of the ePub readers it became evident that the conversion result was less then stellar. The text was mangled and jumbled and the ePub was basically useless.

At this point I decided that conversion from PDF is an inexact science and most attempts would  not yield a usable ePub file. Fortunately I still had the original copy of my book as a Word file and figured that would be a much better starting point. What I found incredible was that Word itself has no means of exporting to ePub. Seems unbelievable, but that is the case.

Googling possible options I was back to the freeware product, Calibre. Calibre can be used as a digital library and a reader and it offers some simple conversion tools as well. This article shows how a Word file can be converted to ePub using Calibre. Following the instructions, I was able to tag the book chapters in Word, save the book as html and then make the conversion to ePub in Calibre. Finally I had the ePub version of my book and I confirmed this by loading it in both Calibre and Adobe Digital Editions.

Calibre

Calibre

Time to upload the book to Google Play and be done with this project. Google Play happily accepted the upload and even displayed a progress bar, but in the end it showed no indication that anything was uploaded. I tried multiple times and the result was the same, no indication that I had uploaded anything. What does one do when an app doesn't work, doesn't produce helpful error messages and there's no tech support? Check the help files. Therein was a mention of a product called EPubCheck which one was expected to use against ePub files to validate them before uploading to Google Play.

Seemed like long shot specially since my ePub was working fine with two different viewers, but there was little else I could think of. EPubCheck is written in java and requires JVM to run. Fortunately I already had JVM on my PC so I ran EPubCheck on my ePub file and a flurry of errors and warnings went flying by. How could I have ever been expected to fix all these errors when I didn't even know how to peek inside the ePub file? I ended up downloading a couple of ePub fix and repair utilities but none were able to rid the ePub file of its errors. EPubCheck kept spewing out the same errors over and over.

More online searches led me to a product called Sigil that actually let one open and edit ePub files. Sigil sure delivered. Finally I was able to open the ePub file, locate the errors reported by EPubCheck and fix them. Turns out EPubCheck was just being too picky complaining about some trivial extra fields that Calibre had added based on the original Word file. But apparently Google Play runs EPubCheck against every ePub upload and silently dumps those that don’t pass validation no matter how small the offense.

sigil

Sigil

There was one more revelation here that is noteworthy. While editing the ePub file in Sigil, it occurred to me that the files were in html format. That's when the whole thing started to make sense like an epiphany. The ePub format is actually a collection of html files together with some assets such as image and stylesheet files, zipped and renamed to a .ePub extension. One can open an ePub file by unzipping it and manipulating the files within using the plainest of text editors, like notepad.

One final validation check using EPubCheck and the file was now error-free. I uploaded the file to Google Play, received the indication that the file was received and a few days later, my book was finally available on Google Play in ePub format.

Book on Google Play

Book on Google Play

Your Comment

* Comments are subject to screening and manual approval.

Read Financial Markets  |   Home  |   Web Tools  |   Blog  |   News  |   Articles  |   FAQ  |   About  |   Privacy  |   Contact
Give a few Sats: 1GfrF49zFWfn7qHtgFxgLMihgdnVzhE361
paypal.me/rhashemian
© 2001-2024 Robert Hashemian   Powered by Hashemian.com