[reportlab-users] platypus textbox

Andy Robinson andy at reportlab.com
Mon Sep 29 05:07:28 EDT 2008


2008/9/28 Zach Rezucha <reportlabemail at gmail.com>:

> Hello all,

> I am very new to python and of course reportlab, so you have to talk to me

> like i'm a retard. I need to do a paragraph, but i need to draw it from the

> top left. It draws from the bottom left. I know the canvas origin is on the

> bottom left, and that is fine, it is just the paragraph. Anyone know? Thanx

> -zach


If you're making a full flowing document using Platypus, then the paragraphs
will flow down from the top.

If you just want to draw a single paragraph and nothing else, you should
call

w, h = myPara.wrap(availWidth, availHeight)

which will tell you how much width and height it wants to use up.
Practically, give it a large enough height (e.g. 1000 points) and
the width you want. The return value tells you the height of the
paragraph.

Then, draw at x, y+h instead of x,y


- Andy


More information about the reportlab-users mailing list