def toPdf(self, image):
    printer = QPrinter()
    printer.setPaperSize(QSizeF(210, 297), QPrinter.Millimeter)
    printer.setResolution(600)
    printer.setOutputFormat(QPrinter.PdfFormat)
    printer.setOutputFileName(self.get_path_to_revealer_file('.pdf'))
    printer.setPageMargins(0, 0, 0, 0, 6)
    painter = QPainter()
    painter.begin(printer)
    delta_h = round((image.width() / self.abstand_v))
    delta_v = round((image.height() / self.abstand_h))
    size_h = (2028 + (((int(self.calibration_h) * 2028) / ((2028 - (delta_h * 2)) + int(self.calibration_h))) / 2))
    size_v = (1284 + (((int(self.calibration_v) * 1284) / ((1284 - (delta_v * 2)) + int(self.calibration_v))) / 2))
    image = image.scaled(size_h, size_v)
    painter.drawImage(553, 533, image)
    wpath = QPainterPath()
    wpath.addRoundedRect(QRectF(553, 533, size_h, size_v), 19, 19)
    painter.setPen(QPen(Qt.black, 1))
    painter.drawPath(wpath)
    painter.end()
def toPdf(self, image):
    printer = QPrinter()
    printer.setPaperSize(QSizeF(210, 297), QPrinter.Millimeter)
    printer.setResolution(600)
    printer.setOutputFormat(QPrinter.PdfFormat)
    printer.setOutputFileName(self.get_path_to_revealer_file('.pdf'))
    printer.setPageMargins(0, 0, 0, 0, 6)
    painter = QPainter()
    painter.begin(printer)
    delta_h = round((image.width() / self.abstand_v))
    delta_v = round((image.height() / self.abstand_h))
    size_h = (2028 + (((int(self.calibration_h) * 2028) / ((2028 - (delta_h * 2)) + int(self.calibration_h))) / 2))
    size_v = (1284 + (((int(self.calibration_v) * 1284) / ((1284 - (delta_v * 2)) + int(self.calibration_v))) / 2))
    image = image.scaled(size_h, size_v)
    painter.drawImage(553, 533, image)
    wpath = QPainterPath()
    wpath.addRoundedRect(QRectF(553, 533, size_h, size_v), 19, 19)
    painter.setPen(QPen(Qt.black, 1))
    painter.drawPath(wpath)
    painter.end()