Using <p style="text-align: justify;">...</p>
to justify text generates a paragraph that is not properly justified. It seems that the problem is in the empty space that is left at the end of line.
As generated by flying-saucer: (download simple maven project)
In contrast to the expected rendering as in a browser: (see jsfiddle)
Is there any known workaround for this? Thanks
The problem seems to be that flying-soucer does not use the Paragraph of the underlying itext, but splits the text into the individual lines itself. While doing it, flying-soucer does not remove the trailing empty spaces.
A quick fix is to insert currentLine.trimTrailingSpace(c);
before this call to save().