View Cart

Kindle Fixed Layout Tutorial, Part 3

Tools

A Note on the Templates

Although you aren't required to use the templates available from this site to work your way through these lessons, a few comments are in order for those who do. First, while I have tried to include all relevant code for each feature here, along with key screen captures to illustrate each point, having the actual file to look at will prove useful in most cases. Either template will work for our purposes here, since we will only be looking at the structural files that make the ebook work, and just the basic layouts contained in each. Both templates are designed as companions to the published manual, which looks at every page in detail.

Second, the templates are provided in their source format (.epub), which can be opened and extracted so that you can look at the internal files from which they are constructed, and use them as the basis for your own. In addition, two pre-converted “sample” files are available for download in the Kindle .mobi format for you to load and view on your device or app of choice.

Kindle files cannot be built directly, but must be converted from a "source" file; nor can they be opened for editing directly, but must first be extracted and converted back to epub. In addition, while Amazon accepts Word docs and HTML files into its Kindle Digital Publishing (KDP) ingestion system, epub is the only source that supports fixed layout content, and thus, the only one that concerns us here.

The epub version of the templates will allow you to view the source code referenced in this tutorial, and to replace the template's contents with your own. This tutorial provides step-by-step instructions on how to do just that, but you can make the files from scratch yourself, or modify another ebook file to suit your needs (so long as it's in the public domain).

Both templates are available for free with the purchase of the complete ebook tutorial, How To Make Kindle Comics & Children's Books, which is available for purchase here in a bundle containing the Kindle, ePub and PDF versions for a single price. A print and digital bundle of the guidebook is also available through Amazon, for those who like to have a physical edition in hand. A lengthier discussion on how to use the templates is also included in this section of the book.

In addition to the templates, a number of additional resources will either be required, or come in handy as you set to work creating your masterpiece.

I. CONTENT EDITING

1. Text Editor

Even if your book consists entirely of images, you will still need a good text editor capable of creating clean, plain text files (i.e. not rich text) for inserting formatting data into a handful of required support files. Preferably it should have numbered lines, as this will aid in editing more complex files. I prefer Notepad++ on the PC, while TextWrangler for the Mac is a highly popular free text editor. If you use the default PC or Mac text editor be sure to turn off Rich Text and save your files as plain text. A good web building program such as Dreamweaver is almost overkill for building ebooks, but will certainly do the job. For reasons to be mentioned shortly, I prefer a program that opens quickly, unlike the slower loading Adobe software.

A Note on InDesign: Adobe's premiere layout software will export to epub, but it also inserts a load of extraneous code into the files that make it more complex than necessary to edit, requiring a lot of "clean-up" that is often far more work than creating a file from scratch. Moreover, while basic image-only page layouts will work just fine (for the most part), many of the more advanced features available for Kindle, such as text and image zoom, will rarely work correctly, if at all. This tutorial will not attempt to explain everything you'll need to fix, nor all the bloated code you'll have to manually remove from your epub file in such cases, but only what you need to put into it. Once you've learned that, you'll be more readily able to clean up an InDesign exported epub, should you choose to do so.

Additionally, Amazon themselves now offer an InDesign plug-in for export directly to the mobi format. But again, this does not yet fully support fixed-layout features such as region zoom and panel view. Consequently, I do not cover InDesign exports in this tutorial, nor in the published manual. However, the files produced by the plug-in can be edited using the instructions contained here.

2. Image Editor

Presumably, if you are interested in creating fixed layout ebooks you already have some image content that you want to use. Therefore, you are likely already well versed in the use of graphics editing software. You might, however, only have a handful of photos or some raw art, or even some comic book page scans that you want to make an ebook of, and don't know what to do with them.

Images in Kindle ebooks need be correctly formatted both for pixel resolution as well as file size. Thus, you will need an image editor like Photoshop or the Gimp that can resize images and accurately compress them into JPEGs. In Photoshop, using the "Save for Web" option gives you greater control over the final file size, with several options for retaining the highest quality at the optimal compression level. Image size will be discussed in further detail later in the tutorial.

3. File Compressor / De-Compressor

An epub file is really just a zip package with its extension changed. You can manually change the .epub extension to .zip in order to extract the files inside and add new ones (be sure to change your file browser settings to show extensions so that you can edit them).

However, some programs, such as 7-Zip for Windows and iZip for the Mac (both free), allow you to modify the contents of an epub without changing the extension, or even extracting the files, which can save you a great deal of time. Set your preferred text editor (i.e. Notepad++) as the default in 7-Zip (Tools > Options > Editor) so that you can simply right-click on a file from within the epub archive and select "Edit" to open and modify the file without extracting it. You can also drag and drop new files into the archive, or delete ones that are already in there.

II. CONVERSION TOOLS

1. KindleGen

As mentioned, Amazon provides a free conversion tool called Kindlegen that can produce a final Kindle compliant file that can be uploaded to KDP or distributed to Kindle customers as you see fit. This is the workhorse of your Kindle production pipeline, and will provide you with both fast and accurate conversions, as well as a log detailing any warnings or errors in the output file that need to be addressed.

KindleGen is a command line tool that is simple to use, accepts epub input (as well as X/HTML), and supports all the features of KF8 fixed layout format. Although it may appear complex at first, it is really very simple, and its use will be fully explained in this tutorial. It is available for Windows and Mac, as well as Linux.

A Note on Calibre: Many non-professional ebook creators rely heavily on a readily available (and often updated) free software package called Calibre, created by Kovid Goyal. While Calibre is a fabulous program, both for ebook conversion and organizing your digital library, it does not fully support fixed layout formats, due to their complexity and the proprietary nature of some included code, which will not work in other formats. Do not attempt to use it to produce fixed layout ebooks in Kindle format. The same is true for Sigil.

2. Kindle Previewer

Kindle Previewer is another free tool offered by Amazon that is intended to be used (as the name suggests) for previewing your Kindle file before uploading it to KDP, allowing you to view your ebook as it will look on different Kindle readers. Previewer actually functions as a graphic user interface with Kindlegen, automatically converting epub inputs into Kindle format for previewing. Consequently, you may prefer to use it for this purpose rather that accessing Kindlegen directly.

However, there are some drawbacks. Previewer is supposed to function as an emulator, allowing those who do not own a particular Kindle app or model to see how their ebook will work on any given display. Since few authors can afford to purchase every device available, this can be quite useful.

Unfortunately, the Previewer has been plagued with bugs and is notorious for not displaying content accurately. It will, for example, show two-page spreads for devices that do not support them, and region magnification does not always function as it should, even when coded correctly. Conversely, page layouts will sometimes render correctly in Previewer, but not on the actual device.

Ultimately, it’s better than not having any idea at all, but I highly recommend the real thing whenever possible. If you intend to produce a professional quality Kindle ebook for sale to the public, it is incumbent upon you to acquire at least one current Kindle device on which to test your product for quality assurance purposes. You will earn your investment back in customer satisfaction, which is priceless.

One further drawback to Kindle Previewer is that you cannot use it just to do a quick conversion, since it automatically opens the preview window to your default display mode once the conversion is complete. Even on the fastest machines this takes a little while, and unfortunately you cannot proceed until the preview has been rendered, which adds a series of long delays into the production process that can be avoided by using KindleGen directly.

3. Kindle Comic Creator

Although “KCC” (or KC2 as it is often called) is not technically a conversion utility, it does perform that function via its interface with both Previewer and Kindlegen. Kindle Comic Creator is another graphic user interface, released in April 2013, that ostensibly allows you to produce KF8 fixed layout comics using basic drag-and-drop functionality. I do not, however, recommend you use it for anything but the very simplest of projects, as it has a great number of drawbacks that far outweigh its benefits.

Firstly, you can only create ebooks with the “comic” book-type: there is not even an option to change this. This means that your choices are limited with respect to this utility right from the outset. For example, all live text functionality is disabled in any file exported from KCC, so that there are no highlights or annotations, no dictionary definitions, no search functions or bookmarks available. Moreover, it disables all active hyperlinks (both internal and external) when you add Region Magnification (i.e. Panel View), but disables two-page spreads when RegionMag is absent, so that you can only have one or the other.

Second, it provides only the most basic text formatting options, via a Rich Text Editor that doesn’t even allow for changing text alignment. Moreover, while it supports embedded fonts, it does not actually display them in its preview window, making it impossible to create accurate text layouts without continually converting the file for export to Previewer. These are very basic features that any graphic design program should have.

The primary benefit of KCC is in the ease with which you can create pop-up panels for Panel View. This can, in fact, be done automatically by KCC via its “auto-detect” feature - so long as you have clear and high-contrast divisions between your panels. But even creating manual panel pop-ups is a simple process, since you can drag on corners to resize and reposition any panel overlay.

Because of this, one use you might make of KCC is to set up your initial Panel View layout, and then manually adjust the CSS code in the files it creates. In fact, KCC has a built-in HTML/CSS editor that allows you to make these changes right within the program, but unfortunately it does not always display these changes accurately. But since KCC creates a complete folder hierarchy on your hard drive automatically during the creation process, you can access any of these directly at any time and alter them to suit your needs.

The downside to this, however, is that KCC also adds some extraneous elements to your code, and uses somewhat convoluted nomenclature for many of its entries (mainly by adding something like “data-app-amzn-ke-created-” to the tags), making it more difficult to navigate and fine-tune than if you wrote the basic code yourself. You can clean up the KCC-created code fairly easily, but it’s still an extra (and unnecessary) step.

Again, for any but the most basic layouts I don’t recommend you use Kindle Comic Creator. But if you do, the information given here will allow you to improve the code that it creates.

III. THIRD-PARTY UTILITIES

1. KindleUnpack

In some instances it may be useful to know what's happening inside your Kindle file after it's been converted (to see how much your images have been compressed by Kindlegen, for example, or to see what code is being added or altered). As mentioned, standard unzip software will not suffice, as the final Kindle file is no longer just a zip archive with a different extension, and therefore cannot be extracted in the usual way. For this purpose a tool such as KindleUnpack (formerly known as MobiUnpack) will be required.

This is a python script (and thus requires Python to be installed), that creates a decompiled archive of a Kindle file’s contents, allowing you to see what changes Kindlegen has made. It is also useful to look at the code in other ebooks that have features you might want to add to yours (such as drop caps or floating sidebars, for example), to see how it is done. This is one of the best learning tools available, although the code you’ll find is not always pretty or easy to read. In addition, you can only do this with unencrypted files; and, of course, the contents of those ebooks are protected by copyright, so you can only look and learn!

Bear in mind that KindleUnpack is not required for this tutorial, but its use and purpose will be discussed here to some degree, along with a few of the more interesting results that you may find.

2. KindleStrip

The file created by Kindlegen will always be much larger than the source files from which it was created, and this very often confuses those who don't know why. The reason is because the final file will include both a KF8 formatted version of your ebook as well as a reflowable Mobi7 version for backwards compatibility with older devices that do not support KF8 fixed layouts (now very few) - even if your ebook will never be available for delivery to any of these devices.

In addition, the original source files are also included in the final .mobi package as a zipped archive, just in case Amazon needs them for re-converting later (in the case of software or format updates, for example). However, only the portion relevant to a customer's device will be downloaded from Amazon to their e-reader, so the actual file size delivered will be smaller than the one created. This "deliverable" file size will be listed in the KindleGen output log, as well as on your KDP book page, should you choose to distribute the file through Amazon.

Of course, you may want to "strip" the file of this extraneous content yourself if you plan to sell it elsewhere, such as on your own website, or through other retailers, or even give it away for free. KindleStrip is another python script that fulfills this function, allowing you to remove the uncompressed source content to reduce the final file size.

NOTE: Both of the above are complex programs and procedures intended for advanced users only. I provide them purely for your information, and do not cover their use in this tutorial, nor are they required to proceed. The links provided lead to Wiki pages that detail their use and offer further resources.

IV. DOCUMENTATION

1. Kindle Publishing Guidelines

If you haven't already visited the Kindle Format 8 page at Amazon it would behoove you to do so, as it is the central hub for all things KF8, containing links and information about the format. Along with a FAQ and forum, the primary resource is the Kindle Publishing Guidelines, a pdf document containing all the details Amazon has disclosed concerning Kindle ebook code thus far.

Sadly, there is both a wealth and scarcity of useful data, in unequal measure, some of which is contradictory and some just poorly written, none of which is thorough, although much is critical to know. You'll get the necessary portions here, but I recommend you also read the official guidelines when you find the time. They will make more sense once you have worked through this tutorial.

2. Sample Files

While you're hanging out at Amazon be sure to download the free ebook samples they link to on the KF8 page. These include both reflowable and fixed layout samples, each of which can be downloaded separately, or all together in a zip file from the "Samples" link. These contain both compiled Kindle formats of the ebooks as well as all their source content, including some informative notes within the code. At present, however, they are rather out of date, although they have occasionally been updated. The examples are instructive, if not always clearly explained. There is nothing in them that you will not learn more clearly in this tutorial, and much is missing that is given in great detail here or in the templates.

3. Further Resources

As with most things, the Internet is filled with facts and fancies regarding ebook formatting, some insightful, much confusing, and most awash with errors. There are none that I know of regarding the KF8 fixed layout format specifically that are worth visiting, although there is a great deal of information to be found concerning the ePub standard upon which Mobi files are based. A few stand out for their clarity or wealth of content, and the primary ones among these are listed here for your reference.

Supported HTML5 / CSS3 Tags - Amazon's own page that lists the major elements supported in KF8. Though not exhaustive, these are more than most authors will ever need. The list is also included as an Appendix in the Kindle Publishing Guidelines.

International Digital Publishing Forum (IDPF) - The central hub of the committee tasked with developing and maintaining the ePub spec, on which all major ebook formats are based, including KF8. Because of this it is useful to know the actual code and its parameters, although much of it does not apply since it is not supported in the Kindle format.

MobileRead Wiki - A platform for the discussion and dissemination of information concerning ePub code and file structure, including many sample files created to test out various elements that you can download. This is a great way to learn how to code a specific element or feature of your ebook, although again, it is only marginally applicable to Kindle files.

BISG Field Guide To Fixed Layout - A free ePub / PDF document that discusses a wide range of issues dealing specifically with fixed layout publications, from when and where to use them to the variations currently in use and their major features. While it is a highly useful look at the state of this niche in the industry, its depth can be summed up by the fact that the Kindle format receives just slightly less than one page of analysis (out of 28). BISG also hosts the list of BISAC Subject Headings for book classification, which is available free for online reference.

#eprdctn - Twitter hashtag where ebook production issues are discussed, and help can very often be found when you feel like you are drowning in a sea of unfathomable code.

A number of other specific resources will be mentioned at the points where they are relevant. Additional resources are listed and linked to in the guidebook where the information is applicable.

Top

Join Us
On Google+

Receive Our
RSS Feed

Look For Us
On LinkedIn

View Our Vids
On YouTube