W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2003

Page breaks in 3 column xsl-region-body

From: Robin Harvey <rh@harrogatesoftware.com>
Date: Thu, 18 Sep 2003 14:00:26 +0100
To: "W3C XSL-FO Mailing list" <www-xsl-fo@w3.org>
Message-ID: <LOEKIAPELMAIBNLNMHEJKELOCGAA.rh@harrogatesoftware.com>

Hi.

I have a large xsl-fo with the region-body in 3 columns.  When i try and
force a page break, the output from the xsl-fo (pdf) remains in the column
structure.  I've managed to get headings that span 3 colums, but my attempts
to add a page break in to this have failed.  Here is some code, first the
layout master set, where i define the 3-column layout:

<fo:layout-master-set>
  <fo:simple-page-master master-name="left"
  	page-width="21cm"
  	page-height="29.7cm">
  <fo:region-before extent="25pt" region-name="rb-left"/>
  <fo:region-body margin-top="20pt"
  	margin-bottom="50pt"
  	column-count="3"
  	column-gap="0.2in"/>
  <fo:region-after extent="25pt" region-name="ra-left"/>
  </fo:simple-page-master>

  <fo:simple-page-master master-name="right"
  	page-width="21cm"
  	page-height="29.7cm">
  	<fo:region-before extent="25pt" region-name="rb-right"/>
  	<fo:region-body margin-top="20pt"
  		margin-bottom="50pt"
  		column-count="3"
  		column-gap="0.2in"/>
  	<fo:region-after extent="25pt" region-name="ra-right"/>
  </fo:simple-page-master>

  <fo:page-sequence-master master-name="standard">
  	<fo:repeatable-page-master-alternatives>
  		<fo:conditional-page-master-reference master-reference="left"
  			odd-or-even="even"/>
  		<fo:conditional-page-master-reference master-reference="right"
  			odd-or-even="odd"/>
  	</fo:repeatable-page-master-alternatives>
  </fo:page-sequence-master>
</fo:layout-master-set>

Here is the xsl-region-body.  This is part of the root xsl template and the
fo here is supposed to output a page before the start of the data content.
The <xsl:apply-templates/> at the bottom of this snippet invokes the
templates to output the data, then both indexes:

<fo:flow flow-name="xsl-region-body">
<!-- This stuff for the intro pages -->
<fo:block space-before="18pt"
	space-after="8pt"
	border-after-width="12pt"
	border-before-width="12pt"
	font-family="bookman old style"
	font-size="24pt"
	text-align="right"
	span="all">
	the blue book
</fo:block>
<fo:block space-before="8pt"
	space-after="8pt"
	border-after-width="12pt"
	border-before-width="12pt"
	font-family="bookman old style"
	font-size="20pt"
	text-align="right"
	span="all">
	directory of specialists
</fo:block>
<fo:block space-before="4pt"
	space-after="4pt"
	border-after-width="12pt"
	border-before-width="12pt"
	font-family="arial"
	font-size="18pt"
	text-align="right"
	span="all">
	for the Trent region
</fo:block>

<!-- empty block to force page break?? -->
<fo:block break-before="page"/>
<!--generate the rest of the book -->
<xsl:apply-templates/>

This code doesn't produce a page break, instead the text above flows in the
first column of the data page, with the data in the next column.

The last bit of code shows the second way i've tried to force a page break.
Here, i want to break to a new page because the content after this is an
index, and should be on a separate page to the content.  This is still
within xsl-region-body, so the 3 columns layout remains.  The text
'Alphabetic Index' should span 3 columns on a new page, instead it flows the
same as the rest of the data, and doesn't break the page.

<fo:block space-before="9pt"
  space-after="9pt"
  font-family="sans-serif"
  font-size="16pt"
  line-height="18pt"
  text-align="center"
  background-color="blue"
  color="white"
  span="all"
  break-before="page">
   Alphabetic Index
</fo:block>

I hope i've managed to explain this properly!

thanks in advance
Robin Harvey
Received on Thursday, 18 September 2003 09:00:29 GMT

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