OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] how to add empty pages at the end of the PDF?


On Thu, Sep 11, 2003 at 06:57:39PM +0200, Tobias Reif wrote:
> Hi
> 
> I'm using the docbook.sf.net XSLTs 1.62.0 to get FO from DBX (then I use 
> FOP to get PDF).
> 
> I'd like to add three empty pages at the end.
> 
> There are various hacks possible:
> Just to try it out I inserted
>    <fo:block break-after="page"/>
> at the end of the template that matches the appendix (the last component 
> of my book): I get one empty page at the end of the PDF, but it is 
> numbered. Instead I need completely empty pages; they should be there 
> for notes etc. I don't want to change the page count of the book (the 
> page count of the PDF would obviously increase which is no problem).
> 
> A better solution would be appreciated. The pages should be empty 
> (should not be numbered), and it would be great if I wouldn't have to 
> copy a large template into my driver just to change one detail.

This is one way to do it:

<xsl:template match="book">
    <xsl:apply-imports/>
    <xsl:call-template name="blankpages"/>
</xsl:template>

<xsl:template name="blankpages">
    <fo:page-sequence master-reference="blank">
        <fo:flow flow-name="blank-body">
            <fo:block break-before="page">&#xA0;</fo:block>
            <fo:block break-before="page">&#xA0;</fo:block>
            <fo:block break-before="page">&#xA0;</fo:block>
        </fo:flow>
    </fo:page-sequence>
</xsl:template>

The book template applies imports to do the normal
processing, and then calls the "blankpages" template.
That template starts a new page-sequence using the "blank"
master which has no headers/footers.

To get page breaks, an empty fo:block won't force it.
You need to put something in the blocks, which in
this case is &nbsp; in Unicode.

If you are using FOP, you will need to change the
flow-name="blank-body" to flow-name="xsl-region-body".
Setting fop.extensions turns off setting the region-body
flow name to "blank-body" in the blank page master because
FOP doesn't handle it properly.  It only uses the
default region-body name "xsl-region-body".

You could convert this to a recursive template that uses
a page count parameter for the number of blank pages you
want for a given run.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]