def add_line(self, x1=None, y1=None, x2=None, y2=None, cursor1=None, cursor2=None, stroke="solid"): if cursor1 is not None: if cursor2 is not None: pass elif x2 is not None and y2 is not None: cursor2 = self.page.cursor.copy() cursor2.x = x2 cursor2.y = y2 else: raise Exception("Line not fully specified") elif x1 is not None and y1 is not None: cursor1 = self.page.cursor.copy() cursor1.x = x1 cursor1.y = y1 if cursor2 is not None: pass elif x2 is not None and y2 is not None: cursor2 = self.page.cursor.copy() cursor2.x = x2 cursor2.y = y2 else: raise Exception("Line not fully specified") else: raise Exception("Line not specified") myline = PDFLine(self.session, self.page, cursor1, cursor2, self.draw_color, stroke) myline._draw()
def draw_horizontal_line(self): end_cursor = self.page.cursor.copy() end_cursor.x = end_cursor.xmax myline = PDFLine(self.session, self.page, self.page.cursor, end_cursor, self.draw_color, None) myline._draw()
def addLine(self, x1=None, y1=None, x2=None, y2=None, cursor1=None, cursor2=None): if cursor1 is not None: if cursor2 is not None: pass else: cursor1 = PDFCursor(x1, y1) cursor2 = PDFCursor(x2, y2) myline = PDFLine(self.SS, self.page, self.colorscheme, cursor1, cursor2) myline.draw()
def drawHorizonalLine(self): endcursor = self.page.cursor.copy() endcursor.x = endcursor.xmax myline = PDFLine(self.SS, self.page, self.colorscheme, self.page.cursor, endcursor) myline.draw()