xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bowditch <bowditch_ch...@hotmail.com>
Subject Re: empty page (no headers or footers)
Date Thu, 08 Sep 2005 08:05:29 GMT
George Mardale wrote:

> Hello,
> 
> I am currently experiencing a problem when generating PDFs using FOP. 
> Due to duplex printing, all generated documents must have an even number 
> of pages. So, if a generated document has an odd number of pages, then a 
> blank page should be added at the end of the document. The document must 
> also have a header/footer.
> I tried using force-page-count="even", but due to the header/footer 
> definition, the blank page at the end of the doc is not actually blank 
> (it still contains the header and the footer).
> 
> Do you know how can I remove the header/footer from that page and make 
> it really empty?

It is possible to do what you want using XSL-FO; What you need to do in 
your page-sequence-master in the conditional-page-master-reference in 
addition to specifying odd-or-even="even" you can add an extra criterion 
blank-or-not-blank="blank" This will allow you to select a different 
simple-page-master depending on whether there is actual content on the 
page. So you will select a s-p-m that has no headers/footers if the page 
is blank.

An example should make this clearer:

<fo:layout-master-set>
    <fo:simple-page-master name="odd" page-width="210mm" 
page-height="297mm">
         <fo:region-body margin-top="20mm"/>
	<fo:region-before region-name="oddheader" extent="20mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master name="even" page-width="210mm" 
page-height="297mm">
         <fo:region-body margin-top="20mm"/>
	<fo:region-before region-name="evenheader" extent="20mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master name="noheader" page-width="210mm" 
page-height="297mm">
         <fo:region-body/>
    </fo:simple-page-master>
    <fo:page-sequence-master master-name="all">
         <fo:repeatable-page-master-alternatives>
              <fo:conditional-page-master-reference 
master-reference="odd" odd-or-even="odd" blank-or-not-blank="not-blank"/>
	     <fo:conditional-page-master-reference master-reference="noheader" 
odd-or-even="odd" blank-or-not-blank="blank"/>
	     <fo:conditional-page-master-reference master-reference="even" 
odd-or-even="even" blank-or-not-blank="not-blank"/>
	     <fo:conditional-page-master-reference master-reference="noheader" 
odd-or-even="even" blank-or-not-blank="blank"/>
         </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
</fo:layout-master-set>

HTH,

Chris


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


Mime
View raw message