[reportlab-users] Width of Preformatted?
Robin Becker
robin at reportlab.com
Mon Jul 26 12:33:01 EDT 2010
On 26/07/2010 17:12, Michael Hipp wrote:
> On 7/26/2010 10:55 AM, Robin Becker wrote:
>> On 26/07/2010 16:40, Michael Hipp wrote:
>>> How can I get the width of a Preformatted object?
>>
>> fontSize=cell.style.fontSize
>> fontName=cell.style.fontName
>> w = max([stringWidth(line,fontName,fontSize) for line in cell.lines])
>
> Thanks, I thought the answer might look something like that. Any chance
> we could get that code snippet included in the next version for minWidth?
>
> Thanks,
> Michael
>
>
>
I'll put it in now and see what happens; not sure why the wrap function doesn't
do the right thing; presumably it's being lazy.
--
Robin Becker
More information about the reportlab-users
mailing list