409 marginX = ( |
409 marginX = ( |
410 printer.pageLayout().paintRectPixels(printer.resolution()).x() |
410 printer.pageLayout().paintRectPixels(printer.resolution()).x() |
411 - printer.pageLayout().fullRectPixels(printer.resolution()).x() |
411 - printer.pageLayout().fullRectPixels(printer.resolution()).x() |
412 ) |
412 ) |
413 marginX = ( |
413 marginX = ( |
414 Preferences.getPrinter("LeftMargin") * int(printer.resolution() / 2.54) |
414 int(Preferences.getPrinter("LeftMargin") * printer.resolution() / 2.54) |
415 - marginX |
415 - marginX |
416 ) |
416 ) |
417 marginY = ( |
417 marginY = ( |
418 printer.pageLayout().paintRectPixels(printer.resolution()).y() |
418 printer.pageLayout().paintRectPixels(printer.resolution()).y() |
419 - printer.pageLayout().fullRectPixels(printer.resolution()).y() |
419 - printer.pageLayout().fullRectPixels(printer.resolution()).y() |
420 ) |
420 ) |
421 marginY = ( |
421 marginY = ( |
422 Preferences.getPrinter("TopMargin") * int(printer.resolution() / 2.54) |
422 int(Preferences.getPrinter("TopMargin") * printer.resolution() / 2.54) |
423 - marginY |
423 - marginY |
424 ) |
424 ) |
425 |
425 |
426 width = ( |
426 width = ( |
427 printer.width() |
427 printer.width() |
428 - marginX |
428 - marginX |
429 - Preferences.getPrinter("RightMargin") * int(printer.resolution() / 2.54) |
429 - int(Preferences.getPrinter("RightMargin") * printer.resolution() / 2.54) |
430 ) |
430 ) |
431 height = ( |
431 height = ( |
432 printer.height() |
432 printer.height() |
433 - fontHeight |
433 - fontHeight |
434 - 4 |
434 - 4 |
435 - marginY |
435 - marginY |
436 - Preferences.getPrinter("BottomMargin") * int(printer.resolution() / 2.54) |
436 - int(Preferences.getPrinter("BottomMargin") * printer.resolution() / 2.54) |
437 ) |
437 ) |
438 |
438 |
439 # write a foot note |
439 # write a foot note |
440 s = self.tr("Diagram: {0}").format(self.getDiagramName()) |
440 s = self.tr("Diagram: {0}").format(self.getDiagramName()) |
441 tc = QColor(50, 50, 50) |
441 tc = QColor(50, 50, 50) |