[reportlab-users] frame in pageTemplate

Arkadi Colson arkadi at smartbit.be
Mon Sep 22 05:46:29 EDT 2008


Hi all,


Somebody any idea why I only get one frame on the document instead of 3?
Here is my code:

/ def foot1(self, canvas, doc):
canvas.drawString(inch, 0.75 * inch, "Page %d" % doc.page)


def go(self, outputfile, module):

styles=getSampleStyleSheet()
Elements=[]
Frames=[]

doc = BaseDocTemplate(outputfile)
doc.pagesize = landscape(A4)

frameHead = Frame(10*mm, 170*mm, 277*mm, 30*mm,
id='head', showBoundary=1)
frameFoot = Frame(10*mm, 10*mm, 277*mm, 30*mm,
id='foot', showBoundary=1)
frameBody = Frame(10*mm, 20*mm, 277*mm, 170*mm,
id='body', showBoundary=1)
Frames.append(frameHead)
Frames.append(frameBody)
Frames.append(frameFoot)

Elements.append(Paragraph("Frame one column",
styles['Normal']))
Elements.append(PageBreak())
Elements.append(Paragraph("Frame two columns",
styles['Normal']))

doc.addPageTemplates( PageTemplate(frames=Frames,
onPage=self.foot1) )

# build page
doc.build(Elements)
/

Thanks in advance,
Arkadi


More information about the reportlab-users mailing list