Just to add a note that I could resolve this problem using zero width spaces-

I used the following xsl to add zero width space after each character-


<xsl:template name="zero_width_space_1">
<xsl:param name="data"/>
<xsl:param name="counter" select="0"/>
<xsl:choose>
    <xsl:when test="$counter &lt; string-length($data)">
      <xsl:value-of select='concat(substring($data,$counter,1),"&#8203;")'/>
       <xsl:call-template name="zero_width_space_2">
               <xsl:with-param name="data" select="$data"/>
               <xsl:with-param name="counter" select="$counter+1"/>
          </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="zero_width_space_2">
<xsl:param name="data"/>
<xsl:param name="counter"/>
   <xsl:value-of select='concat(substring($data,$counter,1),"&#8203;")'/>
   <xsl:call-template name="zero_width_space_1">
    <xsl:with-param name="data" select="$data"/>
    <xsl:with-param name="counter" select="$counter+1"/>
  </xsl:call-template>
</xsl:template>

and then placing a call to zero_width_space_1 like following-

<xsl:call-template name="zero_width_space_1">
    <xsl:with-param name="data" select="span"/>
</xsl:call-template>


Now fop wraps the text to new line once it reaches the cell border.

Thanks for all your guidelines.

Sanjeev Gour.


Jeremias Maerki-2 wrote:
> 
> This is an FAQ. Please see:
> http://xmlgraphics.apache.org/fop/faq.html#cells-overflow
> 
> There are a number of posts about this on the mailing list archives, too.
> Good luck!
> 
> BTW, overflow="scroll" doesn't have an effect in FOP!
> 
> On 10.07.2008 08:29:15 SanjeevGour wrote:
>> 
>> Hello, 
>> I am generating a PDF using FOP. I have table which contains large text
>> in
>> cells. This text goes into the next column messing up the data. Following
>> is
>> my xsl - 
>>      <fo:table-cell padding="2pt" border="0.2pt solid black" width="auto">
>>             <fo:block-container width="60px" height="10px"
>> overflow="scroll">
>>               <fo:block>
>>                      
>> tttttttttttttttttttttttttttttttttnnntttnttttttttttttttttt
>>              </fo:block>
>>          </fo:block-container>
>>         </fo:table-cell>
>> 
>> This text wrap correctly when it has spaces in between. That to happens
>> without using fo:block-container. I want when the text is large, it
>> should
>> continue with the next line. I don't know what value to specify and which
>> attributes need to be set for fo:block-container in order to do this.
>> 
>> Any guidelines would be highly appreciated.
>> 
>> Thank you,
>> Sanjeev.
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-to-wrap-text-in-fo%3Atable-cell-tp18376733p18376733.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-wrap-text-in-fo%3Atable-cell-tp18376733p18382089.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to