Sunday, January 6, 2013

Kindle Fixed Layout Functionality [UPDATED 11-16-13]

Before we dive into the next portion of the tutorial, I thought it would be useful to post the following chart which comprises Appendix A of the ebook. This information will be discussed thoroughly and referred to throughout the tutorial, so having it beforehand might be helpful. And since much of it will make no sense without some explanation, I will provide a short introductory breakdown here as well. This will get a little technical, and may well make no sense at first for some of you (if so, just skip it for now and refer back when necessary), but it will all become clear in time. First, the chart...

Function
               Booktype
PC
App
Android
App
Paper
white
Fire
(Gen1)
Fire
(Gen2)
Fire
HD7
Fire
HD9
1 - Letterbox Color
               Comic
               Children
               None

Choice
Choice
Choice

B/W[1]
White
White

White
White
White

White
White
White

Black
White
White

Black
White
White

Black
White
White
2 - Page-Spread
               Comic
               Children
               None

No
No
No

Y/N[2]
No
No

Yes[3]
Yes[3]
Yes[3]

No
No
No

Y/N[2]
No
No

Y/N[2]
No
No

Yes[4]
No
Yes
3 - 
Virtual Panels
               Comic
               Children
               None


No
No
No


Y/N[5]
No
No


Y/N[5]
No
Y/N[5]


No
No
No


Y/N[5]
No
No


Y/N[5]
No
No


Y/N[5]
No
No
4 - HTML Image Zoom
               Comic
               Children
               None


No
No
No


Y/N[6]
Yes
Yes


Yes[7]
No
Yes[7]


No
Yes
Yes


Y/N[6]
Yes
Yes


Y/N[6]
Yes
Yes


Y/N[6]
Yes
Yes
5 - HTML Cover Doubling
               Comic
               Children
               None

[8]
Y
Y
Y

[8]
Y
Y
Y

Y
Y
Y

Y
Y
Y

[8]
Y
Y
Y

[8]
Y
Y
Y

[8]
Y
Y
Y
6 - TOC 
Menu Link
               Comic
               Children
               None


Yes
Yes
Yes


Yes
Yes
Yes


Yes
Yes
Yes


Yes
Yes
Yes


Yes[9]
NO[10]
Yes[11]


Yes[9]
NO[10]
Yes[11]


Yes[9]
NO[10]
Yes[11]
7 - Bookmarks
               Comic
               Children
               None

Yes
Yes
Yes

Y/N[12]
No
Yes

Yes
Yes
Yes

No
No
Yes

No
No
Yes

No
No
Yes

No
No
Yes
8 - Live Text Functions
               Comic
               Children
               None

Yes
Yes
Yes

No
No
Yes

No
No
No

No
No
Yes

No
No
Yes

No
No
Yes

No
No
Yes
9 - Hyperlinks
               Comic
               Children
               None

Yes
Yes
Yes

Yes
Yes
Yes

No
No
No

Yes
Yes
Yes

Y/N[13]
Yes
Yes

Y/N[13]
Yes
Yes

Y/N[13]
Yes
Yes
10 - 
Layout-Blank
               Comic
               Children
               None

[14]
P*
P*
P*
!
!
!

P/L
L
L
P/L
P/L
P/L

[14]
X
X
X

[14]
X
X
X

[14]
L
X
L



[1] Black when RegionMag is present, White otherwise.
[2] Yes when RegionMag is absent, No otherwise. All page spreads have inner margin removed, regardless of Spine property value.
[3] All spreads are two-page when RegionMag is absent, but correct otherwise; inner margins are correct in all cases.
[4] All page spreads have inner margin removed, regardless of Spine property value.
[5] Virtual Panels active only when RegionMag code is absent.
[6] Pinch & Zoom available only when Virtual Panels are active. Zoom and shrink limits are imposed in this case, so that the image cannot be magnified beyond its actual size, nor smaller than the display size, whereas with HTML image zoom you can exceed these limits.
[7] Pinch & Zoom available for all pages, and without tapping, regardless of image insertion method.
[8] As of Kindlegen update 2.91 HTML covers are now always doubled, regardless of variables. If a NAV doc is present with a "cover" landmark, and/or a "cover" Guide item is present, the HTML cover will be moved to the end of the document (i.e. "suppressed"). The suppress action does not occur otherwise, and in this case the HTML cover appears immediately after the cover image, thus doubling the cover.
[9] Only the Go To option available, either in the top or bottom menu, depending on whether RegionMag code is present.
[10] Entire menu is completely absent, providing no navigation links at all.
[11] Bottom menu contains Search option, while a top menu contains Settings (inactive), Go To..., Notes, and Bookmark options. TOC is active on the Go To menu.
[12] Bookmarks active only when RegionMag code is absent.
[13] Both internal and external links are active only when MagRegion is present. Otherwise they are non-functional.
[14] L: Appears in Landscape mode.
      P: Appears in Portrait mode.
      X: Page does not appear in either mode, and can only be accessed via a menu link when in landscape mode.
      !: In both orientations the page is visible when scrolling forward, but after scrolling two or more pages forward and then scanning back again the page is absent; if only one page forward has been turned the page is still present when scrolling back. There is an extended pause as the system tries to determine whether to render or bypass the page.
      *: Since page-spreads are inactive in the PC app, "Portrait" mode is all that is available, even though technically there is no real orientation option.


Each of the 11 rows features one functionality element in KF8 that I have tested on the devices and apps listed in the columns to the right. These are (in order): the Kindle for PC desktop program, the Kindle for Android app, the eInk Paperwhite, both 1st and 2nd generation Kindle Fires, and the new Kindle HD 7" and HD 8.9" devices. I do not have a Mac on which to test the Kindle for Mac desktop application. And, of course, as mentioned in the Introduction, fixed layout files cannot be tested in the Kindle for iOS/iPad app, since transferring them in any way I have attempted (Dropbox / DiskAid / Send To Kindle) actually breaks the file, as it only transfers the mobi7 portion of the file. I have also tested all this on the Kindle 3 keyboard model, but have removed the information here for lack of space, since it is only marginally relevant. It is, however, available in the ebook tutorial Appendix, for those who are interested.

As mentioned previously, there are two official book types for Kindle fixed layouts, defined by the appropriately titled "book-type" metadata value in the OPF file (to be discussed in an upcoming section), these being "children" and "comic." But, of course, you can also enter "none" (or simply leave it out), making essentially a third practical book-type. Unlike all the other Amazon-specific metadata values, which determine functionality for a specific listed attribute (such as fixed-layout or orientation, for example), the "book-type" attribute effects a broad range of overall ebook functionality - none of which is detailed by Amazon in their documentation. Hence, this chart. In it, each of the listed functions has been tested with each of the three book-type values set.

Also, I should point out that in every case changing the book-type made no difference to the functionality of the Kindle for PC app, which appears to simply ignore the setting.

And now the breakdown...

1. Letterbox Color

This refers to the color used to fill in any display space outside the page content area, much like the “letterboxing” used in widescreen movies on a 4:3 format television (or iPad). This is a minor issue, but one that has perplexed many Kindle content creators, who sometimes find a black fill and sometimes white.

As it turns out, the background is only black on the 2nd generation Fire and the two new HD devices when the “comic” book-type is chosen, and white at all other times, with the single peculiar exception of the Kindle for Android app, which has black fill when RegionMag is present, but white otherwise. In addition, the Kindle for PC program still provides the three standard values of white, sepia, or black as offered in reflowable ebooks.

Given that it is the newest of the Kindle line that sport the black background, this may be an indication of future changes. Not critical, but interesting nonetheless.

2. Page Spread

A new function in KF8 is the “page-id” Spine element which purportedly allows for the creation of two-page spreads in landscape mode (either with or without a margin in between). As you can see from the chart, this is not at all consistently true, and even where it functions, it does so in unexpected ways, not at all as described in the Guidelines.

With only a few exceptions, for example, two page spreads are only functional when the “comic” book-type is entered, and in most cases they are presented with no inner margin, even when the “facing-page” property is entered. Moreover, in nearly all instances, page spreads only appear when there is no region magnification code present in the ebook.

Bear in mind that this does not mean a value of “false” is entered for the “region-magnification” metadata value, but that there is no actual code entered anywhere in the publication. The “region-magnification” entry is itself no longer valid, as Kindlegen determines this value for itself by analyzing the content of the files. We’ll discuss this more in a moment when we look at Virtual Panels.

Thus, with just a few exceptions, two page spreads are only available in comics that consist only of images, with no Panel View functions present. In nearly all other cases only one page is shown at a time in landscape mode, regardless of the “page-id” Spine property. Even the Kindle for PC app, which shows an activated two-page button icon, does not actually display two page spreads.

One surprising fact here is that the Paperwhite actually supports Page-Spread in all book-types. This is accessed via the menu’s “View in Landscape” option (which then changes to “View in Portrait”), since the Paperwhite has no internal orientation sensor. Just as interesting is the fact that, while the Kindle 3 does not support Page-Spread, it does default to landscape orientation for the book-type values “children” and “none” (though inexplicably showing only one page at a time), while for comics it reverts to portrait orientation. There is no way to change the orientation from the Kindle 3 menu.

3. Virtual Panels

This new feature is apparently a fallback for fixed layout ebooks that have no custom region magnification elements included, and is active under virtually the same conditions as Page-Spread.

Virtual Panels works by dividing the page into equal quadrants (or “panels”) that are zoomed by tapping and advanced in sequential order by swiping (the ordering being based on the “primary-writing-mode” value to allow for right-to-left and left-to-right reading order). In portrait mode the page is divided into four quadrants, while in two page spreads each page gets three equal vertical divisions for an overall six-panel layout.

Surprisingly, the magnified page can also be scrolled around by dragging, and variably resized using pinch-and-zoom, making it a very nice add-on feature for most fixed layout ebooks (in the absence of precisely placed mag zones, that is).

As with Page-Spread functionality, Virtual Panels is dependent on the complete absence of RegionMag code in the ebook: if any are present, the Virtual Panels features are inactive. And as already mentioned, the “region-magnification” metadata value is entirely irrelevant here, since if there are any pages containing RegionMag code, KindleGen sets this value to “true” even if the metadata value is “false”.

In fact, the metadata entry can be completely absent and KindleGen will still enter a region-mag value of “true” if the code is present anywhere in the publication. Conversely, no region-mag value will be added during conversion if no code is present, even if the metadata value is set as “true”. Here is the KindleGen readout for the region-mag value being added:

While this is what happens when KindleGen ignores the RegionMagnification value:

Notice that the “I1047” entry is entirely absent. It is also interesting that this is handled separately from the other metadata values, which occur before the parsing of the page files, while region-mag now happens after, and apparently as a result of parsing the page contents.

The Virtual Panels feature is only available on the Android app, the Paperwhite, and the newest Kindle Fire models, and again, in most cases, only when the “comic” book-type value is entered.

For an additional difficulty with Virtual Panels, see number 9. Hyperlinks below.

4. HTML Image Zoom

This relates to the HTML <img src> insertion method for adding background images in fixed layout (as opposed to the <div id> method of referencing a CSS background-image url), which allows you to magnify the background image by double-tapping on it, and then using pinch-and-zoom to scale and scroll around the image, which until Virtual Panels was the only way this could be done.

Because both this and Virtual Panels are activated by double-tapping on the image, only one or the other can be present at the same time, although as usual the Paperwhite is something of an exception to this rule. In nearly all instances, however, the HTML image zoom function works.

One further aspect of this issue, however, is not about its functionality, but the use of one image embedding method or the other. Amazon in general recommends the latter, but contradicts themselves at almost every point, including in their own ebook and code examples, where they use the <img src> method almost exclusively, against their own advice.

In fact, Section 4.2.3 of the Guidelines states that the <div id> method is a requirement, because “HTML images interfere with Region Magnification,” which is demonstrably untrue. The crucial point to make here is that Amazon’s “requirement” is non-existent. If you open up a file produced by Kindle Comic Creator you will see nothing but <img src> embedding.

An important distinction to make between Virtual Panels and the HTML <img src> zoom method is that that latter only magnifies the actual background image (which may sometimes be desirable and sometimes not), while Virtual Panels zooms the entire page, including text overlays, making it more like the iPad’s pinch and zoom feature than Kindle’s standard Panel View. Having the additional option of image embedding methods may prove advantageous, depending on your projects.

5. HTML Cover Doubling

This is another example of Amazon giving content creators conflicting information. In Section 4.3.7 of the Kindle Publishing Guidelines (the Fixed Layout Children’s Books section) the 7th Recommendation is that an HTML page containing the cover image be included, with a linear=“yes” value added to its Spine entry, even though in the earlier Section 3.2.3 they unequivocally state that you are only to do this in reflowable files - and with a linear=“no” Spine value added - because the cover image “may appear twice” - which is, in fact, exactly what happens in any case when an HTML cover is included, regardless of the linear attribute value, or even its inclusion.

Furthermore, the “Cover” link in the Kindle menu leads to the jpeg image of the cover, not to the HTML page containing the cover image when one is included, so there is no good reason to include one. When your readers click on the Cover menu link, they will be presented with two consecutive cover images in a row, one JPEG, one embedded in an HTML page, making them assume the page just isn’t turning. Therefore, there is simply no reason whatsoever to include an HTML cover, and every reason not to.

With the 2.8 update to Kindlegen, this cover issue had been somewhat addressed, and ironically by contravening Amazon’s own recommendation, since the conversion process then rejected HTML cover pages in most cases, by "suppressing" the HTML cover:


However, this now only occurs when a "cover" landmark entry is included in the NAV doc or a "cover" Guide item is present, and only if the <linear="no"> attribute is applied to the HTML cover's spine line item. Otherwise this "suppress" action does not occur.

Moreover, while this "suppress" action initially removed the HTML cover from rendering within the document (thereby hiding it), with Kindlegen update 2.91 the "suppress" action now only moves the HTML cover to the end, where it is rendered as the last page of the document.

For a further discussion of this issue, see the Kindle Publishing Forum entry here.

6. TOC Menu Link

This is the remnant of what was once a much more widespread issue, where the “Table of Contents” link was missing from the default “Go To” menu on the newer Kindle devices. Now, however, only the worst instance of this is still present, which is that in ebooks with the “children” book-type value the entire “Go To” menu is inexplicably missing.

Gone. Completely absent. No links to the cover, the beginning, or any other internal links.

Apparently Amazon thinks readers of children’s ebooks don’t use menus. Perhaps they thought removing it was better than including a Go To menu where all the links are non-functional, but even so, removing the option is a bit reactionary, especially considering that the menu is still present and fully functional in all other Kindle readers. Moreover, the TOC is present on all devices with either the “comic” book-type or “none” chosen.

7. Bookmarks / 8. Live Text Functions

Of all the ebook functions that should never be disabled, these are the ones. If any feature promotes  digital reading over print it’s the ability to interact in highly useful and informative ways with the text. Being able to annotate, highlight (without ruining the book!), instantly search the entire text, and get the meaning of any word with just a tap of your finger - not to mention adding as many bookmarks as you like without having to buy a single one - are just some of the wonders that set ebooks apart.

And yet Amazon has somehow decided (intentionally or inadvertently) that these features are not needed in children’s books or comics. For with either of those book-types entered all live text functions are disabled. Only on the PC app are they available in these instances.

Bookmarks have been separated out here, since there are some odd discrepancies that do not correlate to the live text functions - primarily in “comics” on the Android app, where bookmarks are available, but only when Region Mag code is absent. Additionally, the Paperwhite supports bookmarks with all book-types, showing that this is not a “comic” or “children” issue specifically, but a glitch somewhere in the Kindle production system.

Nor is this a fixed layout issue, some odd quirk in the Kindle fixed layout code, since when you delete the book-type value altogether (or enter “none”) all this functionality is back, with the fixed layout still intact. Moreover, it used to function with the “children” book-type as well, but this has been removed with the recent software updates. The “comic” book-type has not had them from the very first.

9. Hyperlinks

Somewhat similar to the live text problem is the issue of interactive hyperlinks, both internal and external. Here this is once again tied to the “comic” book-type, which completely disables all text hyperlinks on the newest Kindle models when the Region Mag is absent. If Region Mag code is present, both internal and external hyperlinks work, but not otherwise. External hyperlinks are even colored blue, but they’re inactive.

In all other cases, with the sole exception of the Paperwhite, hyperlinks work correctly even where live text is disabled. On the Paperwhite, all links are disabled in every instance.

10. Layout-Blank

This is a new issue that was introduced with the inclusion of the “Page-Id” properties to the Spine entries. Essentially a page with this property is intended to be visible only in landscape orientation, but absent from the portrait view. It has never worked correctly from the very start, and only does so now in two instances on the Paperwhite and nowhere else.

In some cases the page is always visible, and others it is never there. Pages with the “layout-blank” value can be accessed from a menu link, making it a useful “hidden” page feature, if it were it at all consistent. But, of course, its default visibility is nowhere near consistent, rendering it useless in any case. Further, on the newer Fire models with the “children” book-type entered there is no menu to access it from. An easy choice to bypass for now.


CONCLUSION

These are all considerations each ebook designer must weigh and make decisions on, based on their project and target audience. Bear in mind that digital publishing is still in its infancy, and in a state of great upheaval at the moment. All of this will settle out in time, but for now we have to be aware of what is possible and what is not, and try to stay abreast of any changes (which are numerous and often). Already this chart shows the great disparity between a single year's development of the Kindle Fire line: in at least half the features listed there is a difference in functionality between the 1st generation Fire and the latest models.

My biggest issue continues to be the lack of support for live text when either booktype value is entered, making my clear recommendation not to add one. The only functionality that will be lost by doing this are the very few instances where Page Spread works with the “comic” value entered, but not when it is absent, as well as Virtual Panels on the same devices.

But since these features are hardly universal, there is very little incentive to add a book-type value at present, unless you are creating image-only comics with no live text to begin with.

The primary exception, unfortunately, is that only the "comic" booktype allows images of up to 800kb in size; otherwise, you're restricted to 256kb for fixed layouts, which can be a significant consideration with the advent of HD displays. Of course, this may all change (and probably will) over time as new updates are rolled out. But one cannot plan current work based on future possibilities. One must take what data is available today and use it to inform your present efforts.

As mentioned, I will update this chart regularly, and note the changes made at the bottom of the post. If a large number of changes are suddenly made - say, when a new line of devices arrives - I will do a new post and reevaluate the situation.

And by the way, if anyone has a Mac with the Kindle desktop app and can test any of these features I would very much appreciate the information. I would love to add it to the chart for reference and will gladly give you ample credit and provide a link, both here and in the published ebook. For that matter, if any of your own testing contradicts what I have listed here, please let me know so I can look into it further. Comment below or send an email to scot(at)fantasycastlebooks.com.



UPDATE 4/28/2013

I have revised and cleaned up the commentary section to incorporate all previous updates into the text (seven since January), and made a few editorial changes for the sake of easier reading.



UPDATE 5/5/2013

Revised the HTML Cover Image commentary (#5) to remove the deleted redundant Section 4.2.4 of the Guidelines (which was just a repetition of the retained Section 4.3.7). The commentary has also been reworded slightly for clarity and concision.

Layout-Blank now works correctly on the Fire HD8.9 with "comic" or no book-type entered, but still not with the "children" book-type value.



UPDATE 7/10/2013

Removed #5 "Cover Image Access" issue, which has been resolved. Renumbered entries accordingly.



UPDATE 8/1/2013

Moved the Letterbox Color line to the top in order to make it easier to compare the Page Spread, Virtual Panels, and HTML Image Zoom functions, which have a bearing on each other, and function (or not) on similar devices. Renumbered the notes accordingly.



UPDATE 11/16/2013

Updated item #5 - HTML Cover Doubling to address a change in behavior that seems to have crept in with the Kindlegen 2.91 update. If an HTML cover page is included (which I highly recommend against), it will now always appear twice, either after the initial cover image, or as the last page of the document, depending on the factors mentioned in the notes added above. The "suppress" action that previously "hid" this page now only moves it to the back, but only under certain conditions.


And just for those who made it this far down the page, here's where all the testing is done...


PURCHASE THE COMPLETE EBOOK TUTORIAL NOW!

The definitive guide to the Kindle fixed layout format, this fully revised and expanded tutorial will take you line-by-line through two working templates, including both the content and support files, as well as all layout and functionality features, explaining in painstaking detail what each element is for, and what your options are in every instance. Purchase includes both Mobi and PDF editions for one price. Also included in the ebook is a code to download both templates for free!

Add to Cart
$7.99
Kindle .mobi format
+PDF Edition