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 bharathi kongara <bh...@yahoo.com> on 2005/08/25 21:00:39 UTC

Deleting a blank page after the last element

Hi 

I've the following template in the style sheet

<xsl:template match="Section">
       <fo:block keep-together="always"
break-after="page" white-space-collapse = "false">
        <xsl:apply-templates select="SectionName"/>
       	<xsl:apply-templates select="SectionHeader"/>
       	<xsl:apply-templates select="Question"/>
	   </fo:block>
 </xsl:template>

I'm using a break-after="page" to force a page break,
as  my requirement is that each section starts on a
new page. But this is forcing a blank page after the
last section in the generated pdf(ofcorse it will). Is
there any way to remove that(either from the style
sheet directly or after the pdf is generated)?

Thanks
Bharathi

Bharathi Kongara,
Graduate Student,
Department of Computer Science,
Utah State University,
Logan,UT 84321


		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

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


Re: Deleting a blank page after the last element

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 25, 2005, at 21:00, bharathi kongara wrote:

Hi,

> I've the following template in the style sheet
>
> <xsl:template match="Section">
>        <fo:block keep-together="always"
> break-after="page" white-space-collapse = "false">
>         <xsl:apply-templates select="SectionName"/>
>        	<xsl:apply-templates select="SectionHeader"/>
>        	<xsl:apply-templates select="Question"/>
> 	   </fo:block>
>  </xsl:template>
>
> I'm using a break-after="page" to force a page break,
> as  my requirement is that each section starts on a
> new page. But this is forcing a blank page after the
> last section in the generated pdf(ofcorse it will). Is
> there any way to remove that(either from the style
> sheet directly or after the pdf is generated)?

You can do this in XSLT like so:

<xsl:template match="Section">
   <fo:block keep-together="always" white-space-collapse="false">
     <xsl:if test="not(position()=last())">
       <xsl:attribute name="break-after">page</xsl:attribute>
     </xsl:if>
     <!-- the rest = same as above -->
   </fo:block>
</xsl:template>


HTH!

Greetz,

Andreas


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