English | Help | Sign in | Give Feedback

How would you rate your experience using this page?

Visit our help center for resources to common issues

Click here to take our survey and give us detailed feedback.

Thank you for your feedback.

Click here to take our survey and give us detailed feedback.

Help Topics

Contact Us

Have feedback? Can't find your answer in our Help pages?

Contact Us

Guidelines for Converting XMDF to KF8

Contents


KindleGen Command

KindleGen accepts the folder containing the XMDF source file as input. KindleGen will also accept .zip files. Use the command:

kindlegen <folder name>

You can use an additional command line option (-intermediate_only) to generate intermediate OPF/HTML files:

kindlegen -intermediate_only <folder name>

This option generates intermediate files as OPF/HTML files in a new folder next to the input folder. KindleGen names this folder with the input folder name followed by _dump. To change anything in the intermediate files, use these intermediate HTML or OPF files. The intermediate HTML or OPF files should follow the guidance outlined elsewhere in this document.

The OPF file is named current_content.opf and can be found at the same location as the main.xml file.

Use the following command to generate the KF8 from OPF/HTML files:

kindlegen <OPF File>


Source Issues

An XMDF source can have multiple issues that degrade the reading experience on Kindle. You can correct these issues to improve the reading experience. The following sections list a few of the top source issues found in our testing,

Poor Image Quality

Bad quality images will result in the cover or other image being displayed too small. To avoid this, provide good quality images. See quality requirements.



Blurred Gaiji Characters

Replace Gaiji characters with corresponding code characters or provide high quality images of at least 64 x 64 to avoid blurring.

Requirements for Gaiji image files:

  • Image format: PNG (8-bit) format or JPEG format
  • Size: 128 x 128 pixels or greater is recommended


TOC Entries Not Linked

All TOC items must be linked to the corresponding chapter.



Incorrect Number Orientation in TOC

Apply tate-chu-yoko style for TOC index numbers to avoid incorrect number orientation.

Correct:

<char_id char_id = "CR0020">

<yoko>10</yoko>

</char_id>

CHAPTER X

Incorrect:

<char_id char_id = "CR0020">10</char_id>

CHAPTER X


Bold Kanji Characters

Avoid bold style for Kanji characters. This sort of styling makes the characters look blurred.

Correct:

Incorrect:

<font bold = "yes">遺</font>


Faded Text

Leave the text color unspecified. Using light colors results in faded text. Some Kindle devices allow the reader to change the background color to black. If text is forced black, it will not be readable in this mode and the book will be suppressed.



No Space Between Images

Use line breaks (<br/>) to avoid images rendered without space.

Example:

<object type="image/png" src="image1.png"/>

<br/>

<object type="image/png" src="image2.png"/>



Images Not Shown In Separate Pages

To display images on separate pages, use separate chapters for each image.



TOC Not Shown

To ensure that the TOC is shown, include all of the important links in <special_page_link>.

Example:

<special_page_link>

<special_page title="Chapter 1">PG1111</special_page> <special_page title="Chapter 2">PG1112</special_page> ...

</special_page_link>



Large Amount of Text Is Not Centered

Do not use the valign="middle" style for large amounts of text.



Duplicate IDs

Do not use the same Flow ID/Page ID mentioned in the source. Use unique ID names.



File Path and File Name Requirements

Do not use the backward slash (\) for specifying file path; always use the forward slash (/) instead. Do not include special characters (such as !, @, #, $) in the file path or file name.





Unsupported Features

Some XMDF features are not supported in Kindle. If the file has such features, KindleGen displays an error message and fails the conversion. These are the unsupported features.

Serial No.

Feature

Tag

Example

1

Image animations

flip_animation

<flip_animation renewal_time="500ms" > <flip_animation_source src="aaa9.jpg" type="image/jpeg"/>

<flip_animation_source src="aaa2.jpg" type="image/jpeg"/>

...

</flip_animation>

2

Comic books

comic_object_entry

<parts_module>

<object_table>

...

<comic_object_entry src="comic9.xml" type="application/x-bvf-comic" object_id="OB0001"/>

</object_table>

</parts_module>

3

Sound media

sound_object_entry

<parts_module>

<object_table>

...

<sound_object_entry src="movie9.3g2" type="video/3gpp2" object_id="OBmv00"/>

</object_table>

</parts_module>

4

Movie media

movie_object_entry

<parts_module>

<object_table>

...

<movie_object_entry src="movie9.3g2" type="video/3gpp2" object_id="OBmv00"/>

</object_table>

</parts_module>

5

Search pages

search_page_object_entry

<parts_module>

<object_table>

...

<search_page_object_entry src="spage9.xml" type="text/x-bvf-search-page" object_id="OBSP01" />

</object_table>

</parts_module>

6

Clickable area in images

pointer_region

<event>

<trigger>

<trigger_pointer id="OB003k/CR0001" action_flag="click">

<pointer_region>

<vertex position="(0,0)"/>

<vertex position="(100,0)"/>

<vertex position="(100,100)"/>

<vertex position="(0,100)"/>

</pointer_region>

</trigger_pointer>

</trigger>

<action>

<action_page_jump page_id="PG0043"/>

</action>

</event>

7

Trigger action pointing to a URL with ampersand HTML entity

action_page_jump

<event>

<trigger>

<trigger_pointer id="OB0006/CR0015" action_flag="click"/>

</trigger>

<action>

<action_page_jump

book="http://www.japanvisitor.com/index.php?c

ID=359&amp;pID=986" book_type="text/html"/> </action>

</event>

Ignored Features

For some features that are not supported, KindleGen does not error out. Instead, KindleGen ignores them and proceeds with the conversion. These are the ignored features.

Serial No.

Feature

Tag/Attribute

Example

1

Pronunciation

Reading attribute

<title reading="PI">π</title>

2

Alternative code and set for Gaiji

Attributes alt_set and alt_code of tag external_char

<external_char alt_set="sh_extchars" alt_code="0x2345" alt="間"/>

3

Permission information

permission_info

<permission_info> <print_permission

permission="authorized"/>

</permission_info>

4

Line breaking method

line_breaking_method

<line_breaking_method method="word_wrap">

5

Play back

action_play

<event>

<trigger>

<trigger_pointer id="OB0006/CR0015" action_flag="click"/>

</trigger>

<action>

<action_play object_id="OBkj23"/>

...

</action>

</event>

6

Opacity for font, background and others

Opacity attribute

<font color="#FF0000" opacity="100"/>

7

Background music

text_default_background_music

<text_default_attribute> <text_default_background_music src="9.mp3" type="application/x-smaf" loop="yes"/>

...

</text_default_attribute>

8

Drop cap

drop_cap

<p drop_cap="2">Alice was...</p>

9

Scrolling text content

scrolling_text

<scrolling_text>

This text will be scrolling over and over

</scrolling_text>

10

Content masking

Mask

<mask>42 </mask>

11

Key entries for search

key_entry

<key_entry>

<key_item search_word="color"

table_id="ST0001">

Color

</key_item>

<key_item search_word="colour"

table_id="ST0002">

Colour

</key_item>

</key_entry>


An unexpected error occurred. Please try again later.
Your session has expired

Please sign in to continue

Sign In
edit