2

The css style "word-wrap: break-word" does not work while I export the html file to PDF by flyingsaucer.

I defined a class in css file

.class-name{
  word-wrap: break-word
}

and below is my html file

<table class="class-name">
<tr>
  <td>
    something very long
    ...
    ...
    ...
  </td>
</tr>
</table>

I followed the solution in number cannot be wrapped in flyingsaucer and itext but it did not work.

The version of my flyingsaucer is >9 and the version of itext is 2.1.7

Ted Lo
  • 23
  • 3

1 Answers1

4

I also have similar experience. The version of my flying saucer was 9.0.4 and the version of iText was also 2.1.7 .

At first, I was disappointed because I found that "word-wrap" is a CSS 3.0 feature but flying saucer 9.0.4 officially supports up to CSS 2.1 .

However, I find that "word-wrap" still works while I write inline style in HTML file instead of using separate CSS file. You can try the following code to export PDF again.

<table style="word-wrap: break-word">
<tr>
  <td>
    something very long
    ...
    ...
    ...
  </td>
</tr>
</table>
pakyinw
  • 56
  • 4