Sample updated.
This version can be used to test Epub 3.0 compliant eBook reader.
See below, Epub 3.0 and Japanese support for detail.
This is a sample Epub-format digital book in Japanese. Epub is an open digital e-book format adopted by Apple iBookStore, Google Editions and Sony readers. Epub can be used as an input format for an Amazon Kindle book too.
I tested this sample first with a Windows e-book reader application, Adobe Digital Edition. I also tested it with iPad iBooks reader.
Download: epub-sample.zip
Send to iBooks via Podcast: podcast-en.xml
(Clicking this link starts iTunes in your PC and the file is downloaded into the library. At this time, if iTunes asks you to register the Podcast, cancel registration. Then connect iPhone or iPad to PC, sync the content and start iBooks on iPhone or iPad. The sample book should appear on the book shelf.)
See also: Epub Sample Converted to Amazon Format for Viewing in Kindle
See also: Kobu.Com started sales of an Epub Book titled "Java Programming with Mifare and ACR120" through Apple iBooks Store.
This Japanese Epub book (Open eBook) sample was created based on the following Epub sample written in English.
.epub eBooks Tutorial (How to Make an ePub eBook by Hand)
The Epub format is a ZIP file containing XHTML body text files and some XML meta files such as table of contents. As with this example, you can create it only with text editor and zip command. A special authoring tool is not necessarily required.
I used Digital Edition for display testing. It is a reader software from Adobe that runs under Windows and supports Epub.
Actually Japanese characters are not properly displayed if I just replaced characters in the English sample with Japanese characters. I have to add language specification to XHTML files as described in the following link:
In summary, you have to specify language in HTML declaration in XHTML files that constitute the contents of the book.
<html xmlns="http://www.w3.org/1999/xhtml"> | v <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
The Japanese characters displayed properly with this modification.
This sample book consists of three sections; title page, chapter one and chapter two (third chapter added; see EPUB 3.0). The following images show how this sample file looks like when it is opened with Adobe Digital Edition.



Epub is one of open standards for electronic books (eBook); named after the extension of the file containg the book. International Digital Publishing Forum (IDPF) defined this standard.
In summary, an Epub book:
(Rewritten) Epub defines how to package files, specify page navigation order and write table of contents, but it does not define the content document format. Epub adopts HTML and CSS as its document format and defines subset of them. Therefore, we can expect some Epub-compliant eBook readers support HTML and CSS standards beyond the subset defined by Epub.
You can find the following files if you unzip the sample zip file (sample-epub.zip).
sample.epub sample/ mimetype META-INF/ container.xml OEBPS/ content.opf toc.ncx title_page.xhtml chap01.xhtml chap02.xhtml chap03.xhtml <-- added stylesheet.css page-template.xpgt images/ koma.gif (sample.jpg replaced) makeepub.bat
sample.epub is an Epub format ZIP file. Its contents are in sample folder. I renamed the file extension of sample.epub to zip and extract the files in it. I borrowed the original English sample introduced above, and modified or replaced some files in order to test display of Japanese characters. The file names in bold face are modified or replaced files. makeepub.bat is a batch command used to bind contents in sample folder into sample.epub.
The following files are meta files conforming to Epub standard.
| mimetype | File for informing that this is an Epub-format ZIP file. |
| META-INF/container.xml | A file that indicates the location of the OPF file below. |
| OEBPS/content.opf | List of files comprising the book content. All files including XHTML, CSS and graphics. Order of pages (spine) is also described here. |
| OEBPS/toc.ncx | Table of contents. |
The following files are files that make up the Epub book. They are displayable with a web browser.
title_page.xhtml chap01.xhtml chap02.xhtml chap03.xhtml <-- added stylesheet.css koma.gif
The following file is an XML-format stylesheet added by Adobe as an extension to Epub . iBooks does not support Adobe's page template.
page-template.xpgt
You need a ZIP tool to build an Epub-format ZIP file from the source.
But there is a troublesome condition. mimetype must be the first file in the ZIP file and must be uncompressed. I don't know how to add an uncompressed file with Windows XP's builtin ZIP tool (probably we can't do it). I used a command-line ZIP tool which I am familiar with.
makeepub.bat looks like:
cd sample zip -0 ..\sample.epub mimetype zip -r ..\sample.epub * -x mimetype cd ..
Here, -0 option specifies uncompression, -r specifies inclusion of subfolders, and -x specifies files to be excluded.
(2011/05/13) A blogger, TACSI MORI, pointed out that an extra -X option is necessary to remove file attributes for mimetype in order to be fully compliant with OCF specification.
zip -0 ..\sample.epub mimetype | v zip -0 -X ..\sample.epub mimetype
The latest Web standards (CSS3 and HTML5) that Epub specification depends include support of traditional way of rendering of the document written in the far east countries including Japan. I expect that many web brwosers and eBook readers support these features.
I added a test chapter for these new features. The constructs include vertical writing, ruby (small characters by side), horizontal writing among vertical writing, emphasis dots and line break rule. Because I have no way to test this myself right now, it may contain mistakes. Please email me if you find something wrong, or good, in my sample.
Source for the new chapter: chap03.xhtml
The following is a display of the test chapter in Internet Explorer 6.0. You can see IE has supported Japanese text rendering in an early stage. All features except emphasis dots and line break seems to be working.
A file slightly modified to show in IE 6.0: tate-ie60.htm
Next, I show you a display of the sample with Google Chrome browser (dev version 16). All features seems to be working except horizontal layout within vertical layout using text-combine.
A file slightly modified to show in Chrome 16: tate-chrome16.htm
Chrome's Web rendering engine is WebKit. Safari, Android and iOS browsers also use Webkit for their engine. Note that WebKit versions used by these browsers are different.
The author has tried FireFox 3.6.23 (Gecko) but was not successful with vertical rendering.
Other document samples in this site are:
Kobu.Com's related businesses are:
Kobu.Com welcomes questions and comments about this Epub 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: 2009/09/18
Updated: 2011/11/03
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.