1

I am using below code to generate pdf. But content was adjust to second line. Some text was crossed to pdf.

<fo:table-cell padding-left="5mm" padding-top="2mm">
   <fo:block font-size="10pt" text-align="justify"  wrap-option="wrap">
      Thisistextcharacterlengthissue.Needtofixtextwrapoverthecontentinthisline.Andalsotestspecialcharacters.
   </fo:block>
</fo:table-cell>
lfurini
  • 3,729
  • 4
  • 30
  • 48
Kiran
  • 11
  • 3

1 Answers1

1

The text is your block has no spaces, so FOP finds no place where it can break it to form several lines.

Possible solutions:

  • insert some spaces in the text, if possible
  • set hyphenate="true" language="en", either on the fo:block or on an ancestor element, to enable hyphenation of the text in the block (but this would add an hyphen - at the end of the broken lines)
  • insert some zero-width spaces &#x200B; in the text; these characters have no visible effect, but they signal FOP (or any other formatter) a position where it can end a line if needed
lfurini
  • 3,729
  • 4
  • 30
  • 48