[reportlab-users] a replicated canvas?

Jon Bradley shiftedpixels at gmail.com
Tue Sep 18 07:38:04 EDT 2007

On Sep 18, 2007, at 7:19 AM, Robin Becker wrote:

> You can create a form and place that multiple times on the same pdf

> canvas.


> So if you have a pdfgen.canvas.Canvas instance c


> you can do


> c.beginForm('myform')

> c.saveState()

> c.draw...... other ops etc etc

> c.rstoreState()

> c.endForm()


> to define the form and later


> c.doForm('myform')


> you can repeat the doForm in different userspace transformations to

> get the form in different places on the page.

Ah... that sounds great. But then what do I do about modifying that
text field within "c" during my loops for placing it on the page. Can
I modify the form after the fact - ie, c.myform.value = something,
then process the doForm method at the current x,y position?

Thanks a ton for the help. I'm quite a newbie on reportlab (and it's
been years since I've scripted in Python), so bear with me. ;)



More information about the reportlab-users mailing list