[reportlab-users] Draw images with canvas and use SimpleDocTemplate

Tim Roberts timr at probo.com
Mon Mar 21 16:06:00 EDT 2011

slothy Rulez a lot wrote:


> I'm newbee using reportlab, I'm writing pdfs with reportlab inside a

> django view, they are very simple, the header, the contents and the

> footer.


> I'm using SimpleDocTemplate wich fits very well, to draw tables in the

> contents, the footer and the header are drwan using:


> build([data], onFirstPage=drawPageFrame, onLaterPages=drawPageFrame).

> My question is, How can I draw a image like using

> Canvas.drawImage(...)? I need a "floating" image... positioned over

> the text where I want, and with SimpleDocTemplate I don't have a

> Canvas object to do this.

What do you mean by "floating", exactly? Are you trying to draw a
watermark image on the page, behind the text? Does the image need to
flow with the text, attached to some particular word, like an <image>
tag? Does the text need to wrap around the image?

There may be a way to do what you need, but we'd need more information.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

More information about the reportlab-users mailing list