[reportlab-users] Line-wrapping in tables
timr at probo.com
Mon Apr 7 12:55:36 EDT 2014
Steve Hill wrote:
> I'm having some trouble making line-wrapping or Paragraphs work in
> tables. If the Paragraph text has spaces in it then it works fine, but
> text that has no spaces doesn't wrap at all - it (rather unreadably)
> overflows off the right hand side of the table cell and then off the
> edge of the page.
> Is there any way for me to tweak the line wrapping rules to make them a
> bit more sensible?
What would be "more sensible"? ReportLab doesn't do hyphenation. If
there are no spaces, then there's no place to break.
Genuine hyphenation is hard. Really hard. There is a dump hyphenator
in ReportLab (lib/textsplit.py), but it doesn't use English rules. It
just inserts the hyphen at the last place it fits.
If you just want to have the long text wrap at the last character that
fits, you can do that yourself. It's not hard.
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users