[reportlab-users] canvas inside canvas?

Oliver Bleutgen reportlab-users@reportlab.com
Wed, 17 Sep 2003 19:57:31 +0200


Hi all,

I have a canvas which contains several fixed sized areas, in which my 
application adds images (via canvas.drawImage(...)). Now I want to 
extend that to canvas-like objects, i.e. something like

canv =  canv.Canvas(filename, pagesize=(1000,1000))
subcanv1 = canv.Canvas('dummy.pdf', pagesize=(500,500))
subcanv1.lines( ... ) # draw some lines
subcanv1.drawImage( ... ) # draw an image
# this doesn't exist:
canv.drawCanvas(subcanv1, 0,0,500,500)

Any tricks how to do something like that? Perhaps by mucking around with 
subcanv1._code?

Or would the graphics.Drawing class be the thing to look at?
It seems to be able to hold Bitmap Images, though this is undocumented.

Thanks for the great product, btw.

cheers,
oliver