FOP warning:line 1 of a paragraph overflows the available area by more than 50 points

krishna singh picture krishna singh · Sep 29, 2011 · Viewed 7.2k times · Source

Just to make sure I would like to share my understanding of FOP vre 1.0 with you, FOP uses a automated line breaking algorithm i.e when data overflows the width of a table cell,FOP looks for white space in the data and if it finds a white space,then it wraps the data that overflows from the nearest white space into next line of that cell.

But what if the data don't has a white space,then then FOP is not able to wrap data. This is the problem I'm facing.

I write this code.

<fo:table-cell border="solid">
<fo:block hyphenate="true" language="en" wrap-option="wrap">
<xsl:value-of select="welcomeMsg"></xsl:value-of>
</fo:block>
</fo:table-cell>

but it overflows from table cell,instead of wraping because the welcomeMsg is a long string with no white spaces in between.I need the welcomeMsg to be wrapped inside table cell.

Answer

Jeremias M&#228;rki picture Jeremias Märki · Sep 30, 2011

Apache FOP implements the Unicode UAX #14 algorithm for line breaking. So, if a word (or loooong number) cannot be broken and therefore overflows a table-cell, it's because of that algorithm. The usual work-around is to insert zero-width spaces (&#x200B;) into fields that you know could cause overflows. That can easily done via XSLT. See also: XSL-FO: Force Wrap on Table Entries