Books·Featured·Self Publishing

Seeking Validation … for My Kobo EPUB File

8 minute read

kobo_logoAfter listening to The Self Publishing Podcast for the last six months, I decided to drop my involvement in KDP Select and begin offering my ebook through multiple online outlets.

From the words of praise that the podcast gave to Kobo, both for their support of indie authors and the ease of use of their backend system, I opted for Kobo as my first foray into self-publishing on a platform other than the 900-lb publishing gorilla that is Amazon.com.

While there are a number of sites that will take your .mobi, .epub, .doc, or .pdf and both format it and publish it for you on these alternative self-publishing platforms, I opted to do it myself for the sheer sake of the knowledge gained by going through the process. I considered BookBaby, and many self-publishers use Smashwords, but even those sites have certain issues to take into account when using them. For instance, depending on what option you choose with BookBaby, you’ll be giving up a percentage of sales for each book sold.

Even though I knew I’d likely be frustrated by the time-consuming process of uploading my ebook to various sites, I wanted to know how these sites compare to Amazon. I’ve only uploaded my book to Amazon, Kobo, and Nook, and the process has been painless … for the most part.

As with most issues in life, laying a sure foundation can save you from a number of future headaches. When it comes to self-publishing, your sure foundation is a well-formed, properly formatted file.

This was my major problem when uploading to Kobo.

Note that this issue wasn’t Kobo’s fault. It was entirely my own. They needed a clean, validated EPUB file before accepting my book, so it was on me to provide the right file. Using the same Scrivener project in which I compiled the mobi version of my Kindle ebook, I compiled to the EPUB format. I thought that was all I needed to do.

I thought wrong.

After completing the short amount of basic information that Kobo requested about my book, I uploaded my EPUB file, cautiously optimistic that I’d be able to have the Kobo version online in the same day.

Your File Could Not Be Uploaded

My dreams of easy DIY were dashed with that simple error message. Unfortunately, Kobo didn’t relate why my file couldn’t be uploaded. After a quick search, I discovered the online EPUB Validator from the International Digital Publishing Forum. It’s not much to look at, but it serves an invaluable purpose. By uploading your EPUB file to that site, you’ll be presented with a list of specific problems with your EPUB file.

Here are the actual errors from my EPUB file. Click the image to enlarge it.

EPUB Validator  beta  Results

I uploaded my book and was presented with 35 errors, many of which were similar. While this helped me solve why my EPUB file wasn’t being accepted by Kobo, the errors that the online EPUB Validator displays might as well be written in an alien language. I know enough code to be dangerous, but a typical self-publisher may be daunted by the errors they see.

If there’s one thing I’ve learned about self-publishers, they don’t give up.

[Tweet “Determination to see a job through to completion is a hallmark of an indie author.”]

I wasn’t going to let these 35 errors defeat me, so I searched for more help.

How to View Individual Files in an EPUB

I discovered that an EPUB file is essentially a special type of zip file. In other words, it’s a compressed file format that can be “unzipped,” revealing its multiple documents within. For instance, in regards to the errors I received, I had no idea how to edit OPS/body7.xhtml. How could I edit that single file when it was hidden from me within the EPUB file?

I eventually stumbled upon ePub Zip/Unzip (download link), a Mac-only AppleScript application that does two things and does them well. After installing the program and using it to unzip my EPUB file, I could now view and edit my EPUB’s separate files.

Here’s what the unzipped EPUB file structure looks like. You’ll notice that I can now easily locate OPS/body7.xhtml.

epub file structure

How to Edit EPUB files

I opened the problematic xhtml files in Komodo Edit, a free code editor for Mac, Windows, and Linux.

The EPUB Validator provides you with the Line and Position numbers of the error, i.e. my first error occurred on Line 69, Position 17. In my instance of Komodo Edit, the line numbers weren’t turned on by default, so I selected “View” in the top menu and then “View Line Numbers.” The line numbers appeared on the left side of the page. I scrolled down to Line 69 and used my cursor until the status bar at the very bottom of the application showed me column number 17 (equal to the Position number). Once there, I could finally understand the error message I’d received.

As you can tell, a majority of my issues involved paragraph (<p>) and list (<li>) tags. When looking at the code, I could easily see that I had misplaced <p> tags within a list I’d created. Since it happened multiple times within the same list, that’s why I had 31 similar errors. I also had two unclosed <ul> tags and two more list item (<li>) issues in my voluminous footnotes section.

Once I fixed all of those problems, either through deletion or ensuring that open tags had their proper closing tags, I used ePub Zip/Unzip to zip all of those files back into the EPUB format, resulting in one single file containing all of the folders I’d just unzipped and edited.

I uploaded that EPUB file to the EPUB validator and received what I’d been looking for for so long: validation.

Lastly, I uploaded my freshly validated EPUB file to Kobo and was greeted with a warm welcome message of success. Though it took me longer than I anticipated, I was thrilled to have figured out the issues.

Now The Gospel According to Breaking Bad is available on Kobo thanks to the EPUB Validator, ePub Zip/Unzip, and Komodo Edit.

Have you had problems with EPUB files?

read more:

8 Replies

  1. So Scrivener created these errors in the compile? Is there a way to fix the problem in Scrivener so a proper file gets compiled and you don’t have to edit the epub?

  2. As far as I know or recall, there’s not a way to view the underlying XHTML output within Scrivener, so you’d have to compile, validate, then unzip if needed.

    I know that one of my ill-formed tags was a result of me having to futz with a list in my book that wasn’t formatting correctly for my mobi file. I’m not entirely sure if the issue was Scrivener’s fault or mine. That particular issue was so long ago that I can’t remember precisely what was going on.

    Are you a Scrivener user? What format(s) do you mostly compile to?

  3. I wasn’t thinking of editing output in Scrivener. I was thinking of editing the source so that the compile produce proper html.

    I use Scrivener for mobi and epub for Amazon and B&N. (I gave up on iBooks as way too much trouble for very little revenue.) Haven’t bothered with Kobo, yet.

    I also use it to produce Word files for critique and edits.

    Because Scrivener’s widow/orphan control is unacceptable, I’m still doing the print book with InDesign.

  4. Holy crap Blake, you just saved my bacon with this article! I just did EXACTLY what you did, compiled to epub from Scrivener, uploaded to Kobo and got an error message – but with no helpful information as to why!

    Now I’m sorted – thanks again 🙂

  5. Glad it helped you Lise. Did you find the article via a Google search?

    I’m probably going to have to re-read this article as I’m about to convert my new editing book into an epub. If only there was a magic (cost-free) button that converted our books to all the major formats!

  6. Hey Blake – yes I did find this in a Google search 🙂

    I wish there was that button, lol. Scrivener is awesome, but damn if it doesn’t throw a couple of curveballs with the compile to epub!!

    Good luck!

  7. THANK YOU!!!

    Turns out it was one small error: how I wrote the publication date in the metadata in Scrivener. It’s uploaded fine to Nook, iBooks, etc. Just had an issue with Kobo. Thanks so much!

Leave a Reply

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