[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] adding a cover image to the PDF
Hi Robert,
The existing template that matches on book in fo/division.xsl already calls the
template named "front.cover", so you don't need that bit. For the other template, I
think all you need to add is putting the content into a page-sequence, which can be
done with the utility template named "page.sequence" created for that purpose. An
example of its usage is here:
http://www.sagehill.net/docbookxsl/PageDesign.html#CustomPageSequences
In your case, it might look like this:
<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="content">
<mediaobject ...
</xsl:with-param>
</xsl:call-template>
</xsl:template>
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
----- Original Message -----
From: "Robert Nagle" <idiotprogrammer@gmail.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, August 25, 2010 8:13 AM
Subject: [docbook-apps] adding a cover image to the PDF
> Hi, there I need to produce a pre-release of my print book as a PDF.
> It's due tomorrow. It won't be "totally ready" (and I have not added
> a title page), but I just wanted to include a jpg for the page that
> will be the front cover.
>
> I'm using Apache FOP, although eventually I'll be using XEP.
>
> This seems hard.
>
> Reading through the docs and the mailing list, I tried to do this in
> my xslt file:
>
> *****************************************
> <xsl:template name="front.cover">
> <mediaobject>
>
> <imageobject role="fo">
> <imagedata fileref="fo-images/criteria-tag312.jpg"
> contentwidth="7cm"/>
> </imageobject>
> </mediaobject>
>
> </xsl:template>
>
> <xsl:template match="book">
> <xsl:call-template name="front.cover"/>
> <xsl:apply-imports/>
> </xsl:template>
> *****************************************************************************
> I'm sure I'm missing some subtlety here, but shouldn't be easy as this?
>
> One other thought is that perhaps front.cover needs to be in fo, but
> frankly I have no idea how to go about that.
>
> This is stuff I need to learn pretty soon anyway, but for tomorrow is
> there a simple and dirty solution to this?
>
> in my index.xml I have this at the top:
>
> <info>
> <title>My Book Title </title>
> <author>
> <personname>
> <firstname>Robert </firstname>
> <surname>Nagle </surname>
> </personname>
> </author>
> <!--<cover>
> <mediaobject>
>
> <imageobject role="fo">
> <imagedata fileref="fo-images/criteria-tag312.jpg"
> contentwidth="7cm"/>
> </imageobject>
> </mediaobject>
> </cover>-->
> ***************************** I tried referencing it here also without success
> </info>
>
>
>
> --
> Robert Nagle
> 12777 Ashford Point Dr #1417
> Houston, Texas 77082
> 713 893 3424
> htpt://www.robertnagle.info
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]