A few changes in the stylesheets that reside in the fo subfolder of the docbook xsl directory are required
Caution
Before changing any stylesheet please save a copy!
Edit the fo/division.xsl stylesheet and change as explained below
Locate <!-- Placeholder templates -->
Replace the <xsl:template name="front.cover"/> and <xsl:template name="back.cover"/> by
<xsl:template name="front.cover"> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference">titlepage</xsl:with-param> <xsl:with-param name="force-page-count">end-on-even</xsl:with-param> <xsl:with-param name="content"> <fo:block> <fo:external-graphic src="full/path/to/your/cover.png" width="100%" height="100%" content-height="scale-to-fit" content-width="scale-to-fit"/> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:template>
Note the force-page-count parameter forces the insertion of a blank page after the cover page
Note the src parameter must contain the full path to the image. Hard-coding is poor practice but the only way to achieve this easily. Rather than changing the name of the cover image in the xsl document the user can replace in the location and under the hard-coded name the desired image
Change xsl:template name='back.cover'
<xsl:template name="back.cover"> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference">titlepage</xsl:with-param> <xsl:with-param name="content"> <fo:block> <fo:external-graphic src="full/path/to/your/cover.png" width="100%" height="100%" content-height="scale-to-fit" content-width="scale-to-fit"/> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:template>
Edit fo/docbook.xsl and locate the paragraph that begins with
<xsl:template match="*">
Add the hard-pagebreak template ahead of the match="*" line
<xsl:template match="processing-instruction('hard-pagebreak')"> <fo:block break-after='page'/> </xsl:template>