[reportlab-users] Width of XPreformatted

Rüdiger Mähl ruediger.maehl at web.de
Wed Jan 11 13:53:11 EST 2012


I found a solution.


> I am trying to find a formula to determine the width of an

> XPreformatted paragraph, but the returned width is way too small.


w = max([stringWidth(line, fontName, fontSize) for line in text.split('\n')])
(But I can't relocate the web address.)

One has to add the left and right padding, as well as the grid line width,
then the table column width is correct.

Many regards,
Rudi


More information about the reportlab-users mailing list