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 Chris Bowditch <bo...@hotmail.com> on 2006/11/30 10:12:55 UTC

Re: page breaks

Shubhrata Tewari wrote:

> Hi,
> I am iterating over a list of tables and I want each table to appear on 
> a a new page.I have set the break-after="page" in the fo:block, but this 
> is creating an unnecessary page at the end of the last element.
> Is there any way to add a page break without introducing an extra page 
> before or after the fo:block?

This is more of an XSLT problem than a XSL-FO one. You can add a test to 
the XSLT so that break-after="page" is added to every table except the 
last one.

>  
> this is the code:
>  
>  
> 
> <xsl:for-each select="table">

<xsl:if test="position()<last()">

> 
> <fo:block padding-start="3.0in" padding-bottom="6pt" space-after="2pt" 
> font-size="{$data_font_size}" font-style="{$font_style}" 
> font-family="{$font_family}" keep-together="always" break-after="page">

</xsl:if>
<xsl:if test="position=last()">
<fo:block padding-start="3.0in" padding-bottom="6pt" space-after="2pt"
  font-size="{$data_font_size}" font-style="{$font_style}"
  font-family="{$font_family}" keep-together="always">

</xsl:if

> 
> .... table contents
> 
> </fo:block>
> 
> </xsl:for-each>

I hope this makes sense.

Chris




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


Re: page breaks

Posted by Shubhrata Tewari <sh...@nagarro.com>.
Thanks, it worked.
----- Original Message ----- 
From: "Chris Bowditch" <bo...@hotmail.com>
To: <fo...@xmlgraphics.apache.org>
Sent: Thursday, November 30, 2006 2:42 PM
Subject: Re: page breaks


> Shubhrata Tewari wrote:
>
>> Hi,
>> I am iterating over a list of tables and I want each table to appear on a 
>> a new page.I have set the break-after="page" in the fo:block, but this is 
>> creating an unnecessary page at the end of the last element.
>> Is there any way to add a page break without introducing an extra page 
>> before or after the fo:block?
>
> This is more of an XSLT problem than a XSL-FO one. You can add a test to 
> the XSLT so that break-after="page" is added to every table except the 
> last one.
>
>>  this is the code:
>>  <xsl:for-each select="table">
>
> <xsl:if test="position()<last()">
>
>>
>> <fo:block padding-start="3.0in" padding-bottom="6pt" space-after="2pt" 
>> font-size="{$data_font_size}" font-style="{$font_style}" 
>> font-family="{$font_family}" keep-together="always" break-after="page">
>
> </xsl:if>
> <xsl:if test="position=last()">
> <fo:block padding-start="3.0in" padding-bottom="6pt" space-after="2pt"
>  font-size="{$data_font_size}" font-style="{$font_style}"
>  font-family="{$font_family}" keep-together="always">
>
> </xsl:if
>
>>
>> .... table contents
>>
>> </fo:block>
>>
>> </xsl:for-each>
>
> I hope this makes sense.
>
> Chris
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
> 


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