Wednesday, February 22, 2012

Kindle Formatting 7: Using KindleGen Alone

I figured out that my previously posted OPF file was not setup to use Kindlegen to create the table of contents. I did not have the "toc.htm" file in the manifest. There was also the problem of overloading the "toc" for both the table of contents and the toc.ncx item. I changed the toc.ncx to id="toc1" and deleted the "Hard Bookmarks" inside the document.htm for table of contents. This allowed Kindlegen to place my Table of Contents where it wanted, which was right after the Cover. Changed items are in red. I hope this helps anyone that is stumped. I no longer have to go through the extra step of using Calibre. This eliminates the pesky blank pages Calibre automatically puts in before each Part and Chapter heading. Because of the flowing nature of e-readers blank pages can cause readers to be confused, thinking the book has ended.

Note: Start, Cover, and TOC points work on Kindle on PC, iPad, and the emulators to "Part 1" where I put the named bookmark. Start does not work on Kindle Fire. On Kindle Fire "start" points to the beginning of the Table of Contents.

Here are the fragments of the OPF file that I changed. Now the Table of Contents for Kindle on PC is active.

<item href="Michals-jpg-kindle.jpg" id="my-cover-image" media-type="image/jpeg" />
<item id="toc1" media-type="application/x-dtbncx+xml" href="toc.ncx"></item>
<item id="toc" media-type="text/x-oeb1-document" href="toc.htm"></item>
<item id="item1" media-type="text/x-oeb1-document" href="MichalsWindow.htm"></item>

<spine toc="toc1">
<itemref idref="toc"/>
<itemref idref="item1"/>



<reference type="toc" title="Table of Contents" href="toc.htm"/>

<reference type="start" title="Startup Page" href="MichalsWindow.htm%23start"></reference>



No comments:

Post a Comment