| 1 |
<?xml version="1.0" encoding="iso-8859-1"?> |
| 2 |
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 4 |
<section id="sec-covers"> |
| 5 |
<title>Book Covers</title> |
| 6 |
|
| 7 |
<para>Since version 0.3.10 dblatex provides a basic support for page-size |
| 8 |
covers, when covers are defined as images to insert at the beginning of the |
| 9 |
document (front cover), or at the very end of the document (back cover).</para> |
| 10 |
|
| 11 |
<para>To specify a cover, set in the book information element, |
| 12 |
<sgmltag>info</sgmltag> or <sgmltag>bookinfo</sgmltag>, the images to use in |
| 13 |
some <sgmltag>cover</sgmltag> elements (DocBook 5) or in |
| 14 |
<sgmltag>mediaobject</sgmltag> with role set to <literal>cover</literal> |
| 15 |
(DocBook 4).</para> |
| 16 |
|
| 17 |
<para>If two covers are specified, it is assumed that the first one is for the |
| 18 |
front cover, and the second one for the back cover. You can play with standard |
| 19 |
<sgmltag>imagedata</sgmltag> width or depth attributes to ensure that the image |
| 20 |
is sized to fit the page covers.</para> |
| 21 |
|
| 22 |
<para>Here are two examples: |
| 23 |
<example><title>DocBook 5 Front and Back Covers</title> |
| 24 |
<programlisting language="XML"><![CDATA[<book> |
| 25 |
<info> |
| 26 |
... |
| 27 |
<cover> |
| 28 |
<mediaobject> |
| 29 |
<imageobject> |
| 30 |
<imagedata fileref="cover-front-72dpi.png" |
| 31 |
format="PNG" depth="100%" width="100%" align="left"/> |
| 32 |
</imageobject> |
| 33 |
</mediaobject> |
| 34 |
</cover> |
| 35 |
<cover> |
| 36 |
<mediaobject> |
| 37 |
<imageobject> |
| 38 |
<imagedata fileref="cover-back-72dpi.png" |
| 39 |
format="PNG" depth="100%" width="100%" /> |
| 40 |
</imageobject> |
| 41 |
</mediaobject> |
| 42 |
</cover> |
| 43 |
</info> |
| 44 |
... |
| 45 |
</book>]]></programlisting> |
| 46 |
</example> |
| 47 |
<example><title>DocBook 4 Front Cover</title> |
| 48 |
<programlisting language="XML"><![CDATA[<book> |
| 49 |
<bookinfo> |
| 50 |
... |
| 51 |
<mediaobject role="cover"> |
| 52 |
<imageobject role="front-large"> |
| 53 |
<imagedata fileref="cover-front-72dpi.png" format="PNG" width="100%" /> |
| 54 |
</imageobject> |
| 55 |
<imageobject role="front"> |
| 56 |
<imagedata fileref="cover-front-10dpi.png" format="PNG" width="444" /> |
| 57 |
</imageobject> |
| 58 |
<imageobject role="front-small"> |
| 59 |
<imagedata fileref="cover-front-10dpi.png" format="PNG" width="444" /> |
| 60 |
</imageobject> |
| 61 |
<imageobject role="thumbnail"> |
| 62 |
<imagedata fileref="cover-front-10dpi.png" format="PNG" width="444" /> |
| 63 |
</imageobject> |
| 64 |
</mediaobject> |
| 65 |
... |
| 66 |
</bookinfo> |
| 67 |
... |
| 68 |
</book>]]></programlisting> |
| 69 |
</example> |
| 70 |
</para> |
| 71 |
|
| 72 |
<para>Note that in DocBook 4, <command>dblatex</command> filters on the same |
| 73 |
roles for <sgmltag>mediaobject</sgmltag> (<literal>cover</literal>) or for |
| 74 |
<sgmltag>imageobject</sgmltag> (<literal>front-large</literal>) than |
| 75 |
the DocBook Project does when it implement covers in epub format.</para> |
| 76 |
|
| 77 |
<para><command>dblatex</command> defines default templates |
| 78 |
<literal>front.cover</literal> and <literal>back.cover</literal> to implement |
| 79 |
covers through images, but you can overwrite them to create your own |
| 80 |
method to build covers.</para> |
| 81 |
|
| 82 |
</section> |