
Japanese DocBook sample updated. Kindle is supported.
This is a Japanese book sample viewable with Amazon Kindle e-book reader. I converted Japanese Epub Sample book into Amazon file format called AZW with an Amazon-provided conversion tool called KindleGen.
Download: kindle-sample.zip
See also the Original Japanese Epub Sample Book.
Amazon sells a viewing device called Kindle for reading digital books sold by Amazon. Amazon also provides free reader application for Windows PC, Macintosh, iPad and iPhone for reading Kindle Books.
Kindle devices and Kindle applications can read text and PDF files. But Amazon distributes Kindle books mainly in a proprietary format called AZW.
Kindle does not directly support Epub format, an open ebook standard supported by major players such as Apple, Google and Sony. However, Amazon allows us to create Kindle ebooks using Epub as a source manuscript format. For this purpose, Amazon provides a free tool called KindleGen for converting an Epub file to AZW. They provide Windows and Linux versions. It is a command-line tool without graphical interface.
In summary, I could successfully display Japanese contents with Kindle for PC. (Added Sep 17, 2010) Recently, I also tested it with the latest Kindle device that contains Japanese fonts.
The following images show how this sample AZW file looks like when it is opened with Amazon Kindle for PC. The sample book consists of three pages; title page, chapter one and chapter two.



In Windows, double-click the file icon of the created AZW file. Kindle for PC starts up and the sample book will be displayed.
(Added 2010 Sep 17)
The following image show how the sample looks like when displayed on Kindle WiFi. Here is the second page of the same file as above.

There are two ways to put your personal AZW file on a Kindle device.
I teseted both methods successfully.
Set up KindleGen.
We are now ready to create a Kindle book.
Change to the folder where the source file resides (in this case sample.epub) and run KindleGen.
kindlegen sample.epub
The file sample.mobi will be created in the same folder as sample.epub. If you want to attach a file extension of .azw, do it as follows (discussed later).
kindlegen sample.epub -o sample.azw
The following help text will be displayed if you run KindleGen without any arguments. This gives us some hints about what kind of things we can do with KindleGen. For example, we can pass an HTML file as an input file.
***********************************************
* Amazon.com kindlegen(Windows) V1.0 build 85 *
* A command line e-book compiler *
* Copyright Amazon.com 2009 *
***********************************************
Usage : kindlegen filename.opf/.htm/.html/.epub [-lowpriority]
[-nomin] [-c0 or -c1 or c2] [-verbose] [-nocopypaste] [-rebuild]
[-onlydeps or -nodeps] [-unicode] [-o <file name>]
Options:
-c0: no compression
-c1: standard DOC compression
-c2: Kindle huffdic compression
-o <file name>: create the output file named <file name>.Do not
specify directory location in <file name>. Create output mobi
file in same directory as .opf file.
-verbose: verbose output
-nocopypaste: does not allow any copy paste of content in Reader
-nomin: do not minimize version
-rebuild: rebuilds all dependencies
-onlydeps: build only needed dependencies
-nodeps: do not check/build dependencies
-unicode: force build of Unicode book
-lowpriority: set the KINDLEGEN thread priority to low (background
build)
-releasenotes: display release notes
-gif: images are converted to GIF format (no JPEG in the book)
The following link describes AZW format in detail:
It says AZW probably stands for AmaZon Whispernet. The AZW format is almost the same as MOBI format of Mobipocket in France purchased by Amazon in 2005. The differences are format of DRM information and degree of compression (see -c2: Kindle huffdic compression above). The predecessor of the Mobipocket format is PalmDoc of Palm.
As we saw above, .mobi extension will be added if you run KindleGen without the output file option. If you rename .mobi extension to .azw and double click the file, Kindle for PC starts up and shows the contents in the same way. However, the file contents of the file created with "-o sample.azw" option and that of sample.mobi created without -o option are not the same.
Anyway, you don't have to worry about which extension to use and minor differences in the formats because you pass your file to Amazon for further processing such as addition of DRM information, compression and encryption before your book will be distributed through Amazon to readers. Amazon will eventually fix things as they need or like.
Next, let's look at MOBI format in detail:
The MOBI format is a binary format. The above link says "the source files follow the guidelines in the Open eBook format." This means the Epub format is being used as a source manuscript format not as a final distributable format. That's why Amazon's KindleGen accepts .OPF and .EPUB as input to KindleGen. They think that the binary file is generated by compiling a text format such as HTML or EPUB.
These conclude that it is wise to prepare your ebook contents in Epub or XHTML format if you want to distribute it in global markets mainly lead by Apple, Amazon or Google.
Other document samples in this site are:
Kobu.Com's related businesses are:
Kobu.Com welcomes questions and comments about this Kindle sample. Please contact us if you need some help with text- and XML-based document creation and digital publishing in general.
Presented by: Kobu.Com
Written: 2010/03/21
Updated: 2012/03/13
The published sample code is a prototype and is not complete.
Please refrain from duplicating the sample code and its document in another place.
This page is link-free. We welcome your questions and comments.