def draw_footer(self, canvas): canvas.saveState() footerwidth = self.dina4[0] - (2 * self.left) canvas.setFillColorCMYK(1, 0.5, 0, 0) canvas.rect(0, 0, width=self.dina4[0], height=50, fill=True) canvas.setFillColorCMYK(0, 0, 0, 0) canvas.setFont(self.font_bold, 14) x = self.dina4[0]/2 canvas.drawCentredString(x, 25, 'www.imko.de') canvas.linkURL('http://www.imko.de', (0, 50, self.dina4[1], 0)) canvas.restoreState()
def draw_footer(canvas, font_size, y): text1 = 'Created with ' + PROGRAM_FULLNAME text2 = PROGRAM_WEBSITE text2_w = stringWidth(text2, FONT_NAME, FOOTER_FONT_SIZE) text2_x = PAGE_SIZE[0] - GRID_OFFSET - text2_w canvas.setFont(FONT_NAME, font_size) canvas.drawString(GRID_OFFSET, y, text1) canvas.drawString(text2_x, y, text2) y -= 0.2 * FONT_SIZE canvas.linkURL('www.' + text2, (text2_x, y, \ text2_x + text2_w, y + 0.8*FONT_SIZE))
def process(self): if 'round' in self.element.keys(): self.callable = 'roundRect' kwargs = dict(self.getAttributeValues(attrMapping=self.attrMapping)) canvas = attr.getManager(self, interfaces.ICanvasManager).canvas # Create a link url = kwargs.pop('href', None) if url: canvas.linkURL(url, (kwargs['x'], kwargs['y'], kwargs['x'] + kwargs['width'], kwargs['y'] + kwargs['height'])) dest = kwargs.pop('destination', None) if dest: canvas.linkRect('', dest, (kwargs['x'], kwargs['y'], kwargs['x'] + kwargs['width'], kwargs['y'] + kwargs['height'])) # Render the rectangle getattr(canvas, self.callable)(**kwargs)
def draw_todo_text(self, canvas): txt = { 'de': 'PDF via Email an [email protected] Betreff: T3P Konfiguration.', 'en': 'PDF via Email to [email protected] Subject: T3P Configuration'} txt2 = { 'de': 'Fügen Sie Ihre PICO-PROFILE T3PN Konfiguration der E-Mail \ bei.', 'en': 'Attach your PICO-PROFILE T3PN configuration to the E-Mail.' } canvas.drawString(self.center, 100, txt[self.lang]) canvas.drawString(self.center, 75, txt2[self.lang]) canvas.rect( self._rect_x(self.center), self._rect_y(75), self.rect_width, self.rect_height*2) mailto = 'mailto:[email protected]?subject=T3p-Konfiguration' canvas.linkURL(mailto, (self._rect_x(self.center), self._rect_y(75), self._rect_x(self.center) + self.rect_width, self._rect_y(75) + self.rect_height*2)) canvas.line(248, 97, 330, 97) self.y -= self.y_decrease
def process(self): if 'round' in self.element.keys(): self.callable = 'roundRect' kwargs = dict(self.getAttributeValues(attrMapping=self.attrMapping)) canvas = attr.getManager(self, interfaces.ICanvasManager).canvas # Create a link url = kwargs.pop('href', None) if url: canvas.linkURL( url, (kwargs['x'], kwargs['y'], kwargs['x']+kwargs['width'], kwargs['y']+kwargs['height'])) dest = kwargs.pop('destination', None) if dest: canvas.linkRect( '', dest, (kwargs['x'], kwargs['y'], kwargs['x']+kwargs['width'], kwargs['y']+kwargs['height'])) # Render the rectangle getattr(canvas, self.callable)(**kwargs)