Following the examples in Nick Wood's discussions PAGE NUMBER APPEARS ON
TITLEPAGE, I have been able to show the background image on the front cover
title page only. However, I still have two problems.
1) I cannot show the image to cover the entire page. It shows with an even
margin of about 1 cm, no matter adjusting margins at page level, margins at
regon-body level, inserted background image width and content to
page.width/height, to absolute values, etc.
2) I wasn't able to remove the header line. I used header.content template
exactly in the same way as I did for footer.content template. I have a
workaround of extending the region-body area so that the line doesn't show.
What would be the proper way?
Please see attached user.pagemasters.xsl
http://old.nabble.com/file/p34321171/user.pagemasters.xsl
user.pagemasters.xsl
Would appreciate any help!
Akagi
Akagi K wrote:
>
> I am using Docbook 4. with FOP 0.95 to product PDFs, and created a
> user.pagemasters.xsl to show an external graphic on the cover title page,
> where the graphic itself was added to book.title.recto.xsl. However, now I
> need to show a background image, the size of the whole page, with the
> title of the document printed over it.
>
> How can I add a background image to book.title.recto.xsl? It would seem
> to be the simplest if I could do that. Please see below for the extract.
> Background-image is a child element of region-body, but I can't add
> region-body nor a background-image to a block.
>
> I have tried the avenue of adding the background image to the
> user.pagemasters.xsl but the image appears on Part title pages also. I
> followed postings from Nick Wood (Page number shows on titlepage) and
> created a new <fo:simple-page-master> with a new master-name to apply to
> '"odd" pages and "rest" of the pages, but this is not reflected in the
> part title pages.
>
> Would be grateful for you guidance!
>
> akagi
>
>
> Extract of book.title.recto.xsl, and extract of user.pagemasters.xsl below
> that:
>
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> version='1.0'>
>
> <xsl:template name="book.titlepage.recto">
>
> <fo:block>
> <fo:table inline-progression-dimension="18cm"
> table-layout="fixed">
> <fo:table-column column-width="2cm"
> border--after-color="red"/>
> <fo:table-column column-width="9.76cm"
> border--after-color="red"/>
> <fo:table-column column-width="6.24cm"
> border-after-color="red"/>
> <fo:table-body>
>
> <!-- space at top -->
> <fo:table-row height="5cm">
> <fo:table-cell line-height="0cm" font-size="0cm"
> number-columns-spanned="3" border-before-color="black"> <!--
> border-before-color="red"-->
> <fo:block>
> </fo:block>
> </fo:table-cell>
> </fo:table-row>
>
> <!-- and so on ... and the line for external graphic -->
>
> <!-- <fo:external-graphic src="url('images/people-logo.png')"
> content-height="29cm" content-width="22cm"/> -->
> </fo:block>
> </xsl:template>
> </xsl:stylesheet>
>
> An extract of the simple-page-mater section from user.pagemaster.xsl:
> <fo:simple-page-master master-name="my-titlepage-first"
> page-width="{$page.width}"
> page-height="{$page.height}"
> margin-top="0cm"
> margin-bottom="0cm"
> margin-left="0cm"
> margin-right="0cm">
>
> <fo:region-body
> margin-bottom="0cm"
> margin-top="0cm"
> background-image="file:images/aepona_cover.png"
> content-height="30cm" content-width="24cm"
> background-repeat="no-repeat"
> column-gap="{$column.gap.titlepage}"
> column-count="{$column.count.titlepage}">
>
> <xsl:if test="$axf.extensions != 0">
> <xsl:call-template name="axf-page-master-properties">
> <xsl:with-param
> name="page.master">my-titlepage-first</xsl:with-param>
> </xsl:call-template>
> </xsl:if>
> </fo:region-body>
> </fo:simple-page-master>
>
> The simple page master for my-titlepage-odd is created similarly, but
> without the background image.
> and ...
> <fo:page-sequence-master master-name="my-titlepage">
> <fo:repeatable-page-master-alternatives>
> <fo:conditional-page-master-reference master-reference="blank"
> blank-or-not-blank="blank"/>
> <fo:conditional-page-master-reference
> master-reference="my-titlepage-first"
> page-position="first"
> maximum-repeats="0" />
> <fo:conditional-page-master-reference
> master-reference="my-titlepage-odd"
> page-position="rest"/>
> <fo:conditional-page-master-reference
> odd-or-even="even" >
>
> <xsl:attribute name="master-reference">
> <xsl:choose>
> <xsl:when test="$double.sided !=
> 0">titlepage-even</xsl:when>
> <xsl:otherwise>titlepage-odd</xsl:otherwise>
> </xsl:choose>
> </xsl:attribute>
>
>
> </fo:conditional-page-master-reference>
> </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
>
--
View this message in context: http://old.nabble.com/Background-image-on-cover-title-page-only-tp34308223p34321171.html
Sent from the docbook apps mailing list archive at Nabble.com.