diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 1aab3c703..798676174 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -852,8 +852,9 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) // Get printer rect acording to our dpi. const QRectF printerPageRect(0, 0, ToPixel(printer->pageRect(QPrinter::Millimeter).width(), Unit::Mm), ToPixel(printer->pageRect(QPrinter::Millimeter).height(), Unit::Mm)); - const double xscale = printer->pageRect().width() / printerPageRect.width(); - const double yscale = printer->pageRect().height() / printerPageRect.height(); + const QRect pageRect = printer->pageLayout().paintRectPixels(printer->resolution()); + const double xscale = pageRect.width() / printerPageRect.width(); + const double yscale = pageRect.height() / printerPageRect.height(); QPainter painter; if (not painter.begin(printer)) @@ -1251,7 +1252,7 @@ void MainWindowsNoGUI::PdfTiledFile(const QString &name) SetPrinterSettings(&printer, PrintType::PrintPDF); // Call IsPagesFit after setting a printer settings and check if pages is not bigger than printer's paper size - if (not isTiled && not IsPagesFit(printer.paperRect().size())) + if (not isTiled && not IsPagesFit(printer.pageLayout().paintRectPixels(printer.resolution()).size())) { qWarning()<