Tuesday, January 24, 2012

Fixing the layout of a reflowable ebook in iBooks

Now I feel less guilty about looking at iBooks Author.

At the end of my last post, I asked if you could add the code that iBooks Author adds to vertically or horizontally block the layout of a regular flowable book. And it turns out that you can!

This is pretty interesting. Remember that with a regular fixed layout book on Apple, you can't change the font or the font size (or the theme). With flowing books you can. But what about if we created a hybrid: a flowing book that only displays in a single large vertical page (portrait orientation) no matter how you hold the iPad.

The trick is to add the orientation lock code to your com.apple.ibooks.display-options.xml file without specifying that the book be fixed layout:

<?xml version="1.0" encoding="UTF-8"?>
<display_options><platform name="*"><option name="orientation-lock">landscape-only</option></platform></display_options>


Imagine the poetry example that I gave last week. If we use the above code on that book, it only shows in a single vertical page, even when the iPad is held horizontally.

Portrait lock on flowing book

But you can still change the font and font size!

I'm wondering if there are a lot of new features in iBooks 2, revealed in the code in iBooks Author ebooks that we can take advantage of for regular EPUB-compatible books.

More soon!

5 comments:

  1. It seems like that should be portrait-only, the way I think about it. Counter-intuitive?

    ReplyDelete
  2. So, there may be bits and pieces of code, to be found in books that are created with iBooks Author, that we can use in our regular EPUB books that we do not have to sell exclusively at the iBookstore. Now, THAT would be interesting!

    ReplyDelete
    Replies
    1. Yes I'm looking for that information. Tried a few hacks but regular HTML just doesn't appear if mimetype is application/x_ibooks+zip.

      I created a tool to convert Powerpoint->HTML5->Fixed layout Epub and it works fine (with animations and embedded fonts). But the epub book layout is not perfect for slides.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Liz, do we know if there is way of forcing a particular mode to ONE PAGE ONLY?

    ReplyDelete

More of my books