Front cover

Style features to format the front cover

Display graphics for front cover

You might require a front cover for PDF and EPUB ebooks, so cop-e-boox lets you specify a graphic or illustration and format that for output.

The stylesheet p3-cover-titlepage.xsl has all features and instructions for you to format the front cover. The details that can be set in the stylesheet are:

XML markup to edit

The XML tagging for a book's front cover is marked up nested inside the <book><info> element as:
<cover role="cover">
Nested inside this <cover> element is markup that contains the graphics for the front cover:
<mediaobject role="cover">
Note: For more details about XML markup for graphics, see the section on Graphics.
For each graphic, change the following markup nested inside <mediaobject role="cover">:
XML markup Description
<textobject><phrase> Description of graphic </phrase> </textobject> Contains the alternate text for an image in EPUB or web pages
<imageobject role="pdf"> Use different values of the role attribute to select different graphics for each ebook format. Options for the role attribute are: pdf | epub | web.
<imagedata fileref="image/filename.gif" format="GIF"> The directory and file name of the graphic, and the format of the graphic. Formats are: GIF | PNG | JPG | SVG.
Note: Graphics must be located in a directory called images to appear in output ebooks. Create this directory in your working directory, which contains all XML files of the book you are currently working on.

Stylesheet settings to edit

The relevant Stylesheet Guide page for the front cover is PDF-frontcover.svg.

Setting the size of the front cover graphic. The stylesheet p3-cover-titlepage.xsl has features to set the height (p3-35) and width (p3-40) of the cover page graphic. These values should match the page size.

Note: If the values at features p3-35 and p3-40 are larger than the page height and width, the front cover graphic might not appear in a PDF (there will be a blank page instead).

Adjusting the position of a graphic on the front cover. Type in a value at the appropriate feature (p3-15 to p3-30). This value can be in any measurement unit, and can be negative.

Note: To adjust the position of the front cover graphic, you need to correctly specify the values. Read the section on Common problems.