```
 class MyDocTemplate(BaseDocTemplate):
        def __init__(self, filename, **kw):
            self.allowSplitting = 0
            apply(BaseDocTemplate.__init__, (self, filename), kw)
            template = PageTemplate('normal', [Frame(1.0*cm, 1*cm, 19*cm, 27*cm, id='F1')])
            self.addPageTemplates(template)

        def afterFlowable(self, flowable):
            if flowable.__class__.__name__ == 'Paragraph':
            text = flowable.getPlainText()
            style = flowable.style.name
            if style == 'Heading1':
                level = 0
            elif style == 'Heading2':
                level = 1
            else:
                return
            E = [level, text, self.page]
    #if we have a bookmark name append that to our notify data
            bn = getattr(flowable,'_bookmarkName',None)
            if bn is not None:
                E.append(bn)
            self.notify('TOCEntry', tuple(E))

 class FooterCanvas(canvas.Canvas):

     def __init__(self, *args, **kwargs):
         canvas.Canvas.__init__(self, *args, **kwargs)
         self.pages = []

     def showPage(self):
         self.pages.append(dict(self.__dict__))
         self._startPage()

     def save(self):
         page_count = len(self.pages)
         for page in self.pages:
             self.__dict__.update(page)
             self.draw_canvas(page_count)
             canvas.Canvas.showPage(self)
         canvas.Canvas.save(self)

     def draw_canvas(self, page_count):
         page = "Page %s" % (self._pageNumber)
         self.saveState()
         self.setFont('Times-Roman', 10)
         self.line(40,23,560,23)
         self.drawString(280, 25, page)
         self.line(40, 810, 560, 810)
         self.drawString(40,813,"abc")
         self.restoreState()

```

As you can see this will create TOC as well as header and footer from FooterCanvas class and FooterCanvas class is getting applied to all the pages but I don't want it to be applied to first page of my pdf. So how can I achieve this?