I have a question about the isEmpty-method in Chunk. Right now  it looks
like this:

public final boolean isEmpty() {
    return (content.toString().trim().length() == 0) && (attributes ==
null);
}

and thus finds a chunk representing a newline ('\n') to be empty since
trim() deletes the newline character. Wouldn't this implementation be
better?

public final boolean isEmpty() {
    String contentString = content.toString();
    return (!contentString.startsWith("\n")) &&
(contentString.trim().length() == 0) && (attributes == null);
}

I'm fairly new to iText so I could be wrong here but i do know that
HtmlWriter will not translate newlines into <br />-tags with the current
implementation.


Regards
Nicolas Ivering


_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to