Skip to main content

Posts

Showing posts from June, 2017

Adding back the NCX in EPUB 3

Why NCX again? The use of an NCX file, most commonly toc.ncx, is not required in the EPUB 3 standard. However, preparing files for library agents I was required to include an NCX for backwards compatibility. So here are a few notes and links to example files for reference.
Things to remember Aside from creating an NCX file, it is also necessary to add the attribute toc="ncx" to your spine element, like so,
<spine toc="ncx"> inside your OPF file and to include a link to the ncx inside the OPF's manifest tags as well, e.g.
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />Note: The actual value of the spine element's toc attribute is arbitrary, it must simply match the id of the item that is the toc.

The ncx will be ignored by EPUB 3 reading systems, which instead of relying on the spine toc attribute for navigation look for the "nav" property applied to an item inside the manifest tags …