xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <pascal.san...@takoma.fr>
Subject Re: Erratic behavior of keep-together.within-page="always"
Date Fri, 17 Feb 2012 15:00:36 GMT
Hi,

XSLT snippet is not appropriate to figure what you describe.
You should a *short* XSL-FO to this thread, that demonstrates the issue
you are describing.

Le 17/02/2012 01:19, Lal Mohanty a écrit :
> I am having a problem with keep-together.within-page="always" in Fop 0.95/1.0. 
> It behaves erratically depending on size of the content. I need to print a 
> letter where all contents (Request/Data/Body/Para and Request/Data/Closure) 
> need to be printed in one page. If it does not fit, I need to take the LAST 
> paragraph of the Request/Data/Para and the Closure to the next page. This 
> works in many cases, but sometimes, FOP squeezes the line-feeds (or takes away 
> the empty lines) to accommodate the whole content in one page. If I have 
> little larger contents, when it feels (I think) that it can not put all in a 
> single page (even after squeezing), it works fine without trimming the line-
> feeds.  
> 
> Any help will be well appreciated. Thanks in advance.
> Here is a sample XSL -
> <xsl:template name="LetterBody">
>     <fo:block white-space-collapse="false" linefeed-treatment="preserve">
>            <xsl:for-each select ="Request/Data/Body/Para">
>               <xsl:if test="position()!=last()">
>                <xsl:if test="Text">
>                     <fo:block font-size="10pt" font-family="Courier">
>                       <xsl:call-template name="WriteASIS">
>                            <xsl:with-param name="buffer" select="string(.)"/>
>                      </xsl:call-template>
>                     </fo:block>
>               </xsl:if>
>             </xsl:if>
>          </xsl:for-each>
>    </fo:block>
> </xsl:template>
> ...
> <xsl:template name="Closure">
> <fo:block space-before="5mm" font-family="Courier" keep-together.within-
> page="always">
>   <xsl:for-each select="Request/Data/Body/Para[last()]/Text">
>        <xsl:call-template name="WriteASIS">
>             <xsl:with-param name="buffer" select="string(.)"/>
>        </xsl:call-template>
>  </xsl:for-each>
>  <xsl:if test="NB21Request/Data/Closure/Text !=''">
>       <xsl:for-each select="Request/Data/Closure/Text">
>           <xsl:call-template name="WriteASIS">
>              <xsl:with-param name="buffer" select="string(.)"/>
>           </xsl:call-template>
>       </xsl:for-each>
>  </xsl:if>
> </fo:block>
> </xsl:template>


-- 
Pascal

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


Mime
View raw message