[reportlab-users] StringWidth Units

Andy Robinson andy at reportlab.com
Wed Mar 18 13:23:33 EDT 2009


2009/3/18 Anthony Plunkett <anthony at thefort.org>:

>

> c.stringWidth("OUTPUT","Courier",18) * mm

> returns 183.69.  But that clearly isn't correct, it's actually more like

> 23mm.


It's returning the size in points. 'mm' is a numeric constant - the
number of points in a millimetre - so you want to divide by mm not
multiply by it.

- Andy


More information about the reportlab-users mailing list