[reportlab-users] drawing on canvas while using platypus

Robin Becker robin at reportlab.com
Thu Aug 5 06:55:57 EDT 2010

On 05/08/2010 08:38, Christian K. wrote:

> Dear list,


> I would like to use platypus due to its simplicity but still need to use

> the canvas draw methods for some pages which should contain exactly

> positioned images and drawings. Currently (as beginner) I see two

> possible ways to achieve that:


> 1) do the drawing from within a page template

> 2) use a Flowable subclass and override the draw method


> Would you recommned either of these or are there better ways?


> Regards, Christian

I guess it depends on whether the images are related to elements of the story
list. If you need to force something on to the same page as another flowable
then you should probably use a flowable with zero width/height (it also needs an
attribute _ZEROSIZE=1 to force some things to take notice of it). Paragraphs
already have a mechanism to allow user code to execute (the onDraw tag) so
perhaps that might also be a possibility. If it is page furniture then it
probably ought to go into the template.
Robin Becker

More information about the reportlab-users mailing list