Ejemplo n.º 1
0
 def __init__(self,
              file_object,
              page_size=A4,
              left_margin=inch,
              top_margin=inch,
              right_margin=inch,
              bottom_margin=inch,
              xdpi=1200,
              ydpi=1200,
              errors=print,
              debug=print,
              compress=True,
              mark_links=False):
     QPaintDevice.__init__(self)
     self.xdpi, self.ydpi = xdpi, ydpi
     self.page_width, self.page_height = page_size
     self.body_width = self.page_width - left_margin - right_margin
     self.body_height = self.page_height - top_margin - bottom_margin
     self.left_margin, self.right_margin = left_margin, right_margin
     self.top_margin, self.bottom_margin = top_margin, bottom_margin
     self.engine = PdfEngine(file_object,
                             self.page_width,
                             self.page_height,
                             left_margin,
                             top_margin,
                             right_margin,
                             bottom_margin,
                             self.width(),
                             self.height(),
                             errors=errors,
                             debug=debug,
                             compress=compress,
                             mark_links=mark_links)
     self.add_outline = self.engine.add_outline
     self.add_links = self.engine.add_links
Ejemplo n.º 2
0
 def __init__(self, file_object, page_size=A4, left_margin=inch,
              top_margin=inch, right_margin=inch, bottom_margin=inch,
              xdpi=1200, ydpi=1200, errors=print, debug=print,
              compress=True, mark_links=False, opts=None):
     QPaintDevice.__init__(self)
     self.xdpi, self.ydpi = xdpi, ydpi
     self.page_width, self.page_height = page_size
     self.body_width = self.page_width - left_margin - right_margin
     self.body_height = self.page_height - top_margin - bottom_margin
     self.left_margin, self.right_margin = left_margin, right_margin
     self.top_margin, self.bottom_margin = top_margin, bottom_margin
     self.engine = PdfEngine(file_object, self.page_width, self.page_height,
                             left_margin, top_margin, right_margin,
                             bottom_margin, self.width(), self.height(),
                             errors=errors, debug=debug, compress=compress,
                             mark_links=mark_links, opts=opts)
     self.add_outline = self.engine.add_outline
     self.add_links = self.engine.add_links