W3C home > Mailing lists > Public > www-xsl-fo@w3.org > November 2006

Re: xslfop footer

From: Chuck Bearden <cfbearden@gmail.com>
Date: Mon, 20 Nov 2006 14:08:57 -0600
Message-ID: <433ebc870611201208u18f66fafy37caed57300af1f7@mail.gmail.com>
To: www-xsl-fo@w3.org

Hi rjk,

I'm still fairly new to XSL FO myself, but I think I see what is going on here.

You can have one 'fo:flow' per page-sequence.  This is for the body of
your text, and typically you place this in the 'xsl-region-body'
region.  To define content for any other region in a page-sequence,
you must do it as an 'fo:static-content', with the region indicated by
the value of the ''flow-name' attribute.  Here's my reworked example
of your sample:

<xsl:template match="/">
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
      <fo:simple-page-master master-name="page" page-height="11in"
      page-width="8.5in" margin-top="0cm"  margin-bottom="0cm" margin-left="0cm"
      margin-right="0cm">
        <fo:region-before/>
        <fo:region-body/>
        <fo:region-after extent="2cm"/>
      </fo:simple-page-master>
      <fo:page-sequence-master master-name="all">
        <fo:repeatable-page-master-alternatives>
          <fo:conditional-page-master-reference
master-reference="page" page-position="first"/>
        </fo:repeatable-page-master-alternatives>
      </fo:page-sequence-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="all">
      <fo:static-content flow-name="xsl-region-after">
        <fo:page-number/><!-- the page number, for example -->
      </fo:static-content>
      <fo:flow flow-name="xsl-region-body">
        <fo:block>
          <!-- Regular flow of content here -->
        </fo:block>
      </fo:flow>
    </fo:page-sequence>
  </fo:root>
</xsl:template>

I think that 'fo:static-content' elements must come before 'fo:flow'
elements in the page sequences.

Hope this helps,
Chuck

On 11/20/06, rjk <emulsifier@gmail.com> wrote:
>
> Hello I am having trouble getting a footer to show up on every page of my pdf
> generated using FOP.  After reading as much information as I could find on
> the subject I still can't get it to work.  I can get it to fall directly
> after my body, but when I do that the footer only shows up on the last page.
> Any help would be appreciated.  Here is what my xsl file looks like: (edited
> to not take up dozens of pages)
>
>     <xsl:template match="/">
>         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>                         <fo:layout-master-set>
>                                 <fo:simple-page-master master-name="page" page-height="11in"
> page-width="8.5in" margin-top="0cm"  margin-bottom="0cm" margin-left="0cm"
> margin-right="0cm">
>                                 <fo:region-before/>
>                                 <fo:region-body/>
>                                 <fo:region-after extent="2cm"/>
>                                 </fo:simple-page-master>
>                                 <fo:page-sequence-master master-name="all">
>                                         <fo:repeatable-page-master-alternatives>
>                                                 <fo:conditional-page-master-reference master-reference="page"
> page-position="first"/>
>                                         </fo:repeatable-page-master-alternatives>
>                                 </fo:page-sequence-master>
>                         </fo:layout-master-set>
>                         <fo:page-sequence master-reference="all">
>                                 <fo:flow flow-name="xsl-region-body">
>                                         <fo:block>
>                                         </fo:block>
>                                 </fo:flow>
>                         </fo:page-sequence>
>                         <fo:page-sequence master-reference="all">
>                                 <fo:flow flow-name="xsl-region-after">
>                                         <fo:block>
>                                         </fo:block>
>                                 </fo:flow>
>                         </fo:page-sequence>
>                 </fo:root>
>         </xsl:template>
>
> Sorry for the noob-like request but I have been trying to figure this out
> for the better part of 2 days now :(
> --
> View this message in context: http://www.nabble.com/xslfop-footer-tf2669796.html#a7444745
> Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
>
>
>
>
Received on Tuesday, 21 November 2006 13:55:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:14 GMT