0

I am working with xsl fo templates and trying to fit a very long String [like this: abcd26a6d91f1cc29c1567f96abcdff41c6d93d6f7302d0fc3bf61664ba9abcd] into a table's column.

As we can see that this string does not contains any whitespace or hyphen, I am unable to fit it inside the column.

It is flowing into other columns. I have tried the following things but did not got the desired behaviour:

<fo:block page-break-inside="avoid" hyphenate="true">$abcd</fo:block>

<fo:block page-break-inside="avoid" keep-together="auto">$abcd</fo:block>

-<fo:block page-break-inside="avoid" keep-together.within-column="always">$abcd</fo:block>

<fo:block page-break-inside="avoid">$esc.escapeXml($stringUtils.join("abcd: ", $abcd))</fo:block>

<fo:block page-break-inside="avoid" wrap-option="wrap">$abcd</fo:block>

What is the right way of doing this ?

Love Babbar
  • 161
  • 4
  • 12
  • 1
    There's multiple similar questions and answers, commonly about breaks in table cells. E.g.: https://stackoverflow.com/questions/4350788/xsl-fo-force-wrap-on-table-entries/33689540#33689540 – Tony Graham Dec 22 '20 at 13:28

1 Answers1

0

You could try overflow:

<fo:block overflow="hidden">$abcd</fo:block>

which prevents text flowing out of its container.

There's also word-break="break-all" if you have long "words" that cannot be hyphenated. Antenna House seems to support that.

You can also insert zero-width spaces every N characters, to force the desired line breaks.

Joe
  • 877
  • 1
  • 11
  • 26