[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: Header in PDF page using XSL-FO
From:       Pascal Sancho <pascal.sancho () takoma ! fr>
Date:       2009-09-17 12:09:20
Message-ID: 4AB226F0.8020409 () takoma ! fr
[Download RAW message or body]

k deepthi a écrit :
> Hi All,
> I have a requirement of some content in the header of page to come in 
> first page only and should not be repeated in all pages. Please 
> suggest me a best solution for the same.
>  
> Regards
> Deepthi.K.
>
Hi,
what you need is to use a couple of  
fo:conditional-page-master-reference, the 1st with the property 
page-position="first".
See attached FO.

HTH,
Pascal


["_test.fo" (text/xml)]

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:svg="http://www.w3.org/2000/svg" xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="firstPage">
      <fo:region-body margin="10mm"/>
      <fo:region-before region-name="xsl-region-before-firstPage" extent="10mm"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="nonFirstPage">
      <fo:region-body margin="10mm"/>
      <fo:region-before region-name="xsl-region-before-nonFirstPage" extent="10mm"/>
    </fo:simple-page-master>

    <fo:page-sequence-master master-name="allPages">
      <fo:repeatable-page-master-alternatives>
        <!-- NOTE: fo:c-p-m must be that order, 1st test at 1st place -->
        <fo:conditional-page-master-reference master-reference="firstPage"
            page-position="first"/>
        <fo:conditional-page-master-reference master-reference="nonFirstPage"
            page-position="any"/>
      </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="allPages">
    <fo:static-content flow-name="xsl-region-before-firstPage">
      <fo:block>first page header</fo:block>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-before-nonFirstPage">
      <fo:block>all otherpages header</fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
      <fo:block>first page content</fo:block>
      <fo:block break-before="page">2nd page content</fo:block>
      <fo:block break-before="page">3rd page content</fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic