432 marginX = ( |
432 marginX = ( |
433 printer.pageLayout().paintRectPixels(printer.resolution()).x() |
433 printer.pageLayout().paintRectPixels(printer.resolution()).x() |
434 - printer.pageLayout().fullRectPixels(printer.resolution()).x() |
434 - printer.pageLayout().fullRectPixels(printer.resolution()).x() |
435 ) |
435 ) |
436 marginX = ( |
436 marginX = ( |
437 Preferences.getPrinter("LeftMargin") * int(printer.resolution() / 2.54) |
437 int(Preferences.getPrinter("LeftMargin") * printer.resolution() / 2.54) |
438 - marginX |
438 - marginX |
439 ) |
439 ) |
440 marginY = ( |
440 marginY = ( |
441 printer.pageLayout().paintRectPixels(printer.resolution()).y() |
441 printer.pageLayout().paintRectPixels(printer.resolution()).y() |
442 - printer.pageLayout().fullRectPixels(printer.resolution()).y() |
442 - printer.pageLayout().fullRectPixels(printer.resolution()).y() |
443 ) |
443 ) |
444 marginY = ( |
444 marginY = ( |
445 Preferences.getPrinter("TopMargin") * int(printer.resolution() / 2.54) |
445 int(Preferences.getPrinter("TopMargin") * printer.resolution() / 2.54) |
446 - marginY |
446 - marginY |
447 ) |
447 ) |
448 |
448 |
449 width = ( |
449 width = ( |
450 printer.width() |
450 printer.width() |
451 - marginX |
451 - marginX |
452 - Preferences.getPrinter("RightMargin") * int(printer.resolution() / 2.54) |
452 - int(Preferences.getPrinter("RightMargin") * printer.resolution() / 2.54) |
453 ) |
453 ) |
454 height = ( |
454 height = ( |
455 printer.height() |
455 printer.height() |
456 - fontHeight |
456 - fontHeight |
457 - 4 |
457 - 4 |
458 - marginY |
458 - marginY |
459 - Preferences.getPrinter("BottomMargin") * int(printer.resolution() / 2.54) |
459 - int(Preferences.getPrinter("BottomMargin") * printer.resolution() / 2.54) |
460 ) |
460 ) |
461 |
461 |
462 # write a foot note |
462 # write a foot note |
463 s = self.tr("Diagram: {0}").format(self.getDiagramName()) |
463 s = self.tr("Diagram: {0}").format(self.getDiagramName()) |
464 tc = QColor(50, 50, 50) |
464 tc = QColor(50, 50, 50) |