Thursday, December 22, 2011

Kindle Fire Book vs. Document

‹prev | My Chain | next›

One of the hardest things to get right with ebook generation is the on-device experience. In part, this is because it is so time-consuming to try out even small changes. I have no idea how to speed up the process of generating the book, mounting an associated device, copying the stinking thing over to the device and then unmounting the device so that the device is back in read mode.

To be sure, sending the book to the device wirelessly is generally a better bet, but then you are at the mercy of network issues. You are never quite sure if the copy on the device is the one you just sent or the one that seemed to get lost 30 minutes ago.

I bring all of this up, because we received a report from Derick Bailey that copying a the mobi version of Recipes with Backbone onto the Kindle Fire fails to register the book as an actual book on the device. Rather it shows up as a "document".

So I regenerate the mobi version of the book:
➜  backbone-recipes git:(master) git-scribe gen mobi
GENERATING EPUB
GENERATING HTML
...
Info(prcgen): The file format version is V6
Info(prcgen): Saving MOBI file
Info(prcgen): MOBI File generated with WARNINGS!
Then I copy the output over to my Fire:
➜  backbone-recipes git:(master) cp output/book.mobi /media/KINDLE/Books 
➜  backbone-recipes git:(master) umount /media/KINDLE 
And sure enough, the book does not show up under "Books" in the Fire, but under "Documents".

But, you know what? So do all of the PragProg books that have been getting sent to the Fire via my @free.kindle.com account. So, at least I am in good company.

Even so, it would be nice if I could get that working.

Derick was kind enough to provide a pointer to get started. In that thread, it is suggested that Calibre might be able to solve the problem if I convert my output to "EBOK" (instead of "PDOC"). So, under preferences / output, I change the output from "[PDOC]" to "[EBOK]":


Then, I load the mobi version of Recipes with Backbone into Calibre, and convert it to... mobi. Again, I copy the book over to the Fire:
➜  backbone-recipes git:(master) cp ~/Calibre\ Library/Nick\ Gauthier/Recipes\ with\ Backbone\ \(30\)/Recipes\ with\ Backbone\ -\ Nick\ Gauthier.mobi /media/KINDLE/Books/book.mobi
➜  backbone-recipes git:(master) umount /media/KINDLE   
And, what do you know? It worked. Recipes with Backbone now shows up under Books on the Fire.

But needing to run the book through a manual process like Calibre is less than ideal.

Unfortunately, the kindlegen tool provided by Amazon does not support setting this value. This looks to be a binary field somewhere in the mobi, so I am hesitant even get into trying to figure this out manually. And to make matters worse, I cannot reverse engineer the mobi because the generated mobi is not unzip-able:
➜  rwb_mobi  unzip book.mobi  
Archive:  book.mobi
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of book.mobi or
        book.mobi.zip, and cannot find book.mobi.ZIP, period.
If I do nothing, I am no worse off than other ebook vendors. Still, it would be cool to solve this. I will have to ruminate some...

Day #242

1 comment:

  1. Hi,
    I tried changing [PDOC] to [EBOK] as you suggested. Then I sent the file over, and it still shows up in the Docs section?

    ReplyDelete