[reportlab-users] canvas inside canvas?

Robin Becker reportlab-users@reportlab.com
Wed, 17 Sep 2003 19:53:05 +0100


In article <3F68A08B.1000602@gmx.net>, Oliver Bleutgen <myzope@gmx.net>
writes
>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
you need canvas forms. I think these are in canvas.py

        see methods beginForm, endForm, doForm.
-- 
Robin Becker