Closed ifindthanh closed 7 months ago
Indeed, BreakLongString
does not break overlong words but lets them fill a line by themselves for as long as they are. The code position deciding this is
if (size > width)
{
if (lastSpace < 0)
lastSpace = spaceIndex;
If you want a different handling of overlong words, you have to change the lastSpace = spaceIndex;
to setting lasspace
to some smaller number. How you choose that number, depends on your preferred word breaking approach.
Discussing word breaking approaches here clearly exceeded the scope of a stack overflow question. Seeing the current implementation, though, it should be easy to extend the code accordingly.
Hi there,
I've posted this question to Stackoverflow but it is deleted by administrator. I'm following the example of BreakLongString.java to show my content in Signature field. The problem is, if the content of my text contains a very long word, this example does not handle this case yet.
For example, this is my text
And the text is truncated in the generated pdf file.
Please help me to have a look on the issue?