
Figure 1. Container with one <rootfile> element
The container is always called container.xml. The example has a <rootfile> element in it that points to the OPF package file ebp.opf in folder OPS. That folder also holds all of the other items in the manifest.
A key strength of epub is that it delivers text that will fit easily on any size of reading device, from the smallest smartphone to the largest PC monitor. Text will flow smoothly from one screen to the next regardless of the size of screen or the size of font that the reader prefers.
Supposing you want to give the reader the ability to print the book in an attractive format. PDF would be a good choice for this. Sites like Smashwords offer separate downloads of epub and PDF versions of a book, but they could be bundled together using the Open Container Format. The OCF is a general-purpose container specification and you can store more than one version of your publication in it.
Figure 2. shows container.xml for a sample book available in the IDPF forums. The book contains some Sherlock Holmes stories and Figure 2. shows how two renditions of the text - OPS and PDF - are represented:

Figure 2. Container with two renditions
Quite simply, there are two <rootfile> elements present, one for each rendition:
<rootfiles>The first <rootfile> identifies the OPF package, as in the earlier example. Reading software designed to handle OPF packages would render the book using information contained in this <rootfile>.
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
<rootfile full-path="PDF/Holmes.pdf" media-type="application/pdf"/>
</rootfiles>
The second <rootfile> points to the file Holmes.pdf in folder PDF and the media-type indicates that this should be handled as a PDF file. Here, then is the alternate rendition for the text. Notice that the container follows the OCF recommendation that alternate renditions should be placed in dedicated folders. Figure 3. illustrates this by showing the folder structure in a WinZip® view of the epub file.

Figure 3. Dedicated folders for alternate renditions
The PDF file is held in a distinct folder in the Zip archive.
Not now, but in the future, you may be able to store more than one publication in an OCF container, for example the complete works of an author held as separate ebooks. This would require the reading software to read the container and present the list of contained ebooks to the reader.
Article Navigation
Next >>