You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by George Mardale <gi...@delsyne.ro> on 2005/09/07 14:59:34 UTC

empty page (no headers or footers)

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?

Thank you for your time,
George.

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


Re: empty page (no headers or footers)

Posted by Chris Bowditch <bo...@hotmail.com>.
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