'Build the document using the flowables.
Set up the page templates that the document can use'

def build(self, header_flowable, body_flowable, footer_flowable, canvasmaker=canvas.Canvas):

    self.header_flowable = header_flowable
    self.body_flowable = body_flowable
    self.footer_flowable = footer_flowable
    self.calc_body_size(header_flowable, footer_flowable)
    showBoundary = 0
    body_frame = Frame(self.leftMargin, (self.bottomMargin + self.footer_height), self.printable_width, self.body_height, leftPadding=0, bottomPadding=0, rightPadding=0, topPadding=0, id='body', showBoundary=showBoundary)
    self.body_frame = body_frame
    self.normalPage = PageTemplate(id='Normal', frames=[body_frame], onPage=self.add_page_decorators, pagesize=self.pagesize)
    self.landscapePage = PageTemplate(id='Landscape', frames=[body_frame], onPage=self.add_page_decorators, pagesize=landscape(self.pagesize))
    if (self.defaultPage == 'Landscape'):
        self.addPageTemplates(self.landscapePage)
    else:
        self.addPageTemplates(self.normalPage)
    BaseDocTemplate.build(self, self.body_flowable, canvasmaker=canvasmaker)
