[reportlab-users] looking for simple images/text example

Aljoša Mohorović aljosa.mohorovic at gmail.com
Tue Feb 22 18:46:41 EST 2011


i'm trying to create a document that has photos on the left side and
text/paragraph on right side.
i can put images with code similar to:
=========================
# doc = canvas.Canvas()
x = 48
y = page_height - 124

# margin on first page: 48 x 124
# img size: 334 x 200
w, h = 334, 200
for p in photos:
img_space = 200 + 20
if img_space > y:
doc.showPage()
y = page_height - 50

img = Image(p, width=w, height=h)
img.drawOn(doc, x, y - img_space)
y -= img_space
=========================

i can't figure out howto then put a large text/paragraph on right side
continuing over several pages?
=========================
P = Paragraph(large_text, para_style)
P.wrapOn(doc, random_value, random_value)
P.drawOn(doc, random_value, random_value)
=========================

with all documentation and mailing lists i can't figure out how to do this.
i can't even figure out what exactly wrapOn does.

if somebody can point me to example that does this simple thing i
would really appreciate it.
i'm sure i'm not the first person looking for this kind of example.

Aljosa


More information about the reportlab-users mailing list