0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54: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 (
@ -342,7 +338,11 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
} else { } else {
isFirst=false; isFirst=false;
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();