When rendering the header (using reportlab), I would like to split it between two lines if it is longer than 45 characters. So far I have this:
if len(Title) < 45: drawString(200, 695, Title) else: drawString(200, 705, Title[:45]) drawString(200, 685, Title[45:])
The problem is that I want to split the title in a natural break, for example where a space occurs. How can i do this?
source share