FOP 警告:段落第 1 行溢出可用区域超过 50 点
只是为了确保我想与您分享我对 FOP vre 1.0 的理解, FOP 使用自动换行算法,即当数据溢出表格单元格的宽度时,FOP 会查找数据中的空白,如果找到空白,则将从最近的空白溢出的数据包装到下一行。那个细胞。
但是如果数据没有空格怎么办,那么 FOP 就无法换行数据。 这就是我面临的问题。
我写这段代码。
<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>
但它从表格单元格溢出,而不是换行,因为welcomeMsg是一个长字符串,中间没有空格。我需要将welcomeMsg换行到表格单元格内。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Apache FOP 实现了 Unicode UAX #14 换行算法。因此,如果一个单词(或很长的数字)无法被破坏并因此溢出表格单元格,那是因为该算法。通常的解决方法是将零宽度空格 (
) 插入到您知道可能导致溢出的字段中。这可以通过 XSLT 轻松完成。另请参阅:如何强制表格条目换行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 (
) into fields that you know could cause overflows. This can easily be done via XSLT. See also: How to force wrap on table entries