Defining Book Layout Metadata

EPUB 3 fixed-layout books use the <metadata> structure to define a book’s layout. In EPUB 2, this metadata was defined in the Apple Display Options file, but in EPUB 3, the metadata is defined in the <metadata> element within the OPF file. For example:

<metadata xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" > <dc:title>Fixed-Layout Book</dc:title> <dc:identifier id="bookid">0123456789</dc:identifier> <dc:language>en</dc:language> <meta property="dcterms:modified">2012-08-15T00:00:00Z</meta> <meta property="rendition:layout">pre-paginated</meta> <meta property="rendition:spread">none</meta> </metadata>

The following table explains the available layout property attributes:

rendition:layout

Example:

<meta property="rendition:layout">pre-paginated</meta>

Defines whether a book is a flowing book or a fixed-layout book. Supported values are reflowable (standard flowing book) and pre-paginated (fixed-layout book). This is equivalent to fixed-layout : true|false in EPUB 2.

rendition:spread

Examples designating two content documents per spread:

<meta property="rendition:spread">auto</meta> or <meta property="rendition:spread">both</meta>

Example designating a single content document per spread:

<meta property="rendition:spread">none</meta>

Defines if there are one or two content documents per spread. Supported values are auto, both, and none.

rendition:flow

Example designating content documents to be rendered in a continuous scrolling view from spine item to spine item:

<meta property="rendition:flow">scrolled-continuous</meta>

Must be defined if your book is to be presented in one continuous scroll without space or gaps in vertical scrolling mode. (See Vertical Scrolling.) Otherwise, a book will be presented vertically with space between content documents.

ibooks:specified-fonts

Example:

<meta property="ibooks:specified-fonts">true</meta>

Must be defined if your book contains embedded fonts. This is equivalent to specified-fonts : true|false in EPUB 2.

Tip: You can use the specified-fonts attribute to override a user’s justification preference. You do not need to use embedded fonts in this instance. Apple Books provides a preference that a user can choose to display the text in a book to full justification. This option overrides any text alignment you specify and justifies all paragraphs in a book, including all headings. You can preserve your text alignment by using the specified-fonts attribute and setting it to true. This attribute preserves the font settings as specified in your CSS stylesheet, as long as the user does not choose a different font when reading the book. When this happens, the justification for paragraphs returns to the user preference, but the text alignment for your headings is preserved. If the user later returns to the “original” font, your text alignments are respected.

Note: When creating fixed-layout books in EPUB 3, you must include the following prefix attribute in the <package> element in the OPF file:

<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="3.0"

   prefix="rendition: http://www.idpf.org/vocab/rendition/#">