epub Format for iBooks
This short tutorial describes epub format as is exported from Pages and as is recognized by iBook app from iPhone and iPad.
The extension for an epub file is .epub.
The file contains a zip archive with the following (simple) structure:
mimetype – file
META-INF – directory
META-INF/container.xml – file
OPS – directory
OPS/cover.xhtml – file
OPS/epb.ncx – file
OPS/epb.opf – file
OPS/CSS – directory
OPS/CSS/book.css – file
OPS/IMAGES – directory
Now we will explain the purpose of those files.
OPS/epb.opf File – Epub format
epb.opf contains epub book metadata, file manifest and linear reading order of the digital book. Linear reading order indicates the order in which files will appear in the book.
XML elements of epb.opf file are:
<package> – root element, required
<metadata> – child element, required, contains metadata information for the book
Note: unique-identifier tag from <package> should be the same as dc:identifier id attribute from <metadata>.
<manifest> – child element, required, describe all files from the epub book, except epb.opf file, mimetype and container.xml.
<spine> – child element, required, lists all content documents
<guide> – child element, optional, used to identify structure of the book.
epb.ncx file contains table of contents for the epub book.
Note: docTitle, docAuthor and meta dtb:uid should match tags /attributes from epb.opf file. Also meta dtb:depth element should have the same value as depth of navMap element. A hierarchical table of elements can be created by nesting navPoint elements.