def drawOn(self, canv, x, y, _sW): # Add outline entry. This is copied from rst2pdf.flowables.heading canv.bookmarkHorizontal(self.parent_id, 0, y + self.image.height) if canv.firstSect: canv.sectName = self.stext canv.firstSect = False if self.snum is not None: canv.sectNum = self.snum else: canv.sectNum = "" canv.addOutlineEntry(self.stext, self.parent_id, int(self.level), False) # And let MyImage do all the drawing MyImage.drawOn(self, canv, x, y, _sW)
def drawOn(self, canv, x, y, _sW): ## These two lines are magic. #if isinstance(self.parent_id, tuple): #self.parent_id=self.parent_id[0] # Add outline entry. This is copied from rst2pdf.flowables.heading canv.bookmarkHorizontal(self.parent_id, 0, y + self.image.height) if canv.firstSect: canv.sectName = self.stext canv.firstSect = False if self.snum is not None: canv.sectNum = self.snum else: canv.sectNum = "" canv.addOutlineEntry(self.stext.encode('utf-8', 'replace'), self.parent_id.encode('utf-8', 'replace'), int(self.level), False) # And let MyImage do all the drawing MyImage.drawOn(self, canv, x, y, _sW)
def drawOn(self,canv,x,y,_sW): ## These two lines are magic. #if isinstance(self.parent_id, tuple): #self.parent_id=self.parent_id[0] # Add outline entry. This is copied from rst2pdf.flowables.heading canv.bookmarkHorizontal(self.parent_id,0,y+self.image.height) if canv.firstSect: canv.sectName = self.stext canv.firstSect=False if self.snum is not None: canv.sectNum = self.snum else: canv.sectNum = "" canv.addOutlineEntry(self.stext.encode('utf-8','replace'), self.parent_id.encode('utf-8','replace'), int(self.level), False) # And let MyImage do all the drawing MyImage.drawOn(self,canv,x,y,_sW)