0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 09:04:39 +03:00

Printing large pages fixed

This commit is contained in:
Arin Alexander 2018-03-15 22:58:08 +03:00
parent 1c379c568d
commit e5e2de70bf

View File

@ -291,10 +291,6 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
qreal leftMargin, topMargin, rightMargin, bottomMargin; qreal leftMargin, topMargin, rightMargin, bottomMargin;
printer.getPageMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin, QPrinter::Millimeter); printer.getPageMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin, QPrinter::Millimeter);
QRectF printerPageRect = printer.pageRect(QPrinter::Millimeter);
printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR,
(printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR);
foreach(PageItemDesignIntf::Ptr page, pages){ foreach(PageItemDesignIntf::Ptr page, pages){
if ( if (
@ -344,6 +340,10 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
painter = new QPainter(&printer); painter = new QPainter(&printer);
} }
QRectF printerPageRect = printer.pageRect(QPrinter::Millimeter);
printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR,
(printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR);
if (printerPageRect.width() < page->geometry().width()){ if (printerPageRect.width() < page->geometry().width()){
qreal pageWidth = page->geometry().width(); qreal pageWidth = page->geometry().width();
QRectF currentPrintingRect = printerPageRect; QRectF currentPrintingRect = printerPageRect;