You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Michel Bergijk <m....@home.nl> on 2000/11/11 16:15:45 UTC
How to set a page break?
Hi all,
While trying to create pdf-reports from data, I stumbled on a problem with page breaks.
Or rather, I can not get my page breaks how I like them. In my XML file I have data
about teams for one month. I want each team displayed on a separate page.
I tried
- page-break.before="always"
- page-break.after="always"
- page-break-after="always"
and
- keep-together.within-page="always"
as shown below.
Nothing helped, the page breaks have their own life. They break the page on places I do not want.
Has anybody an answer on the question how I enforce a page break in my output file?
Part of the XSL file:
<xsl:apply-templates select="month"/>
<fo:block keep-together.within-page="always">
<xsl:for-each select="team">
<!-- Print the team name as caption before the table -->
<fo:block space-before.optimum="1cm" font-size="12pt"
font-weight="bold" font-family="serif" text-align="center">
<xsl:text>Hours of team </xsl:text>
<xsl:value-of select="text()"/>
</fo:block>
<!-- Keep all project codes of a team on one page -->
<!-- The table -->
<fo:table space-before.optimum="8pt"
space-after.optimum="0.6cm" border="2pt" empty-cells="show">
<fo:table-column column-width="2.9cm"/>
<fo:table-column column-width="3.5cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="1.5cm"/>
<fo:table-body>
<!-- The heading of the table. -->
<xsl:for-each select="project_code">
...
</xsl:for-each>
</fo:block>
P.S. The combination of the XML and XSL-file generates a pdf-file.
P.S.2 I know this is more a XSL question, but to get the end result I use fop. I hope this not a problem?
=================================
Michel Bergijk m.bergijk@home.nl
Work Michel.Bergijk@cmg.nl
=================================
Re: How to set a page break?
Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
> - page-break.before="always"
> - page-break.after="always"
> - page-break-after="always"
> and
> - keep-together.within-page="always"
not implemented (see docs). Try break-after and break-before (as in
readme.fo)
Fotis