0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +03:00

Custom size printing has been changed

This commit is contained in:
Arin Alexander 2019-08-29 22:17:34 +03:00
parent 6af025471b
commit 872a2219e0
2 changed files with 7 additions and 4 deletions

View File

@ -681,8 +681,8 @@ QSizeF PageItemDesignIntf::getRectByPageSize(const PageSize& size)
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOrientation((QPrinter::Orientation)pageOrientation());
printer.setPaperSize((QPrinter::PageSize)size);
return QSizeF(printer.paperSize(QPrinter::Millimeter).width() * 10,
printer.paperSize(QPrinter::Millimeter).height() * 10);
return QSizeF(printer.paperSize(QPrinter::Millimeter).width() * LimeReport::Const::mmFACTOR,
printer.paperSize(QPrinter::Millimeter).height() * LimeReport::Const::mmFACTOR);
}
else {

View File

@ -1812,7 +1812,6 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
renderPage.render(m_painter, m_printer->pageRect(), currentPrintingRect);
currentPrintingRect.adjust(printerPageRect.size().width(), 0, printerPageRect.size().width(), 0);
curWidth += printerPageRect.size().width();
}
pageHeight -= printerPageRect.size().height();
curHeight += printerPageRect.size().height();
@ -1822,7 +1821,10 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
}
} else {
renderPage.render(m_painter);
QRectF source = page->geometry();
QSizeF inchSize = source.size() / (100 * 2.54);
QRectF target = QRectF(QPoint(0,0), inchSize * m_printer->resolution());
renderPage.render(m_painter, target, source);
}
page->setPos(backupPagePos);
return true;
@ -1843,6 +1845,7 @@ void PrintProcessor::initPrinter(PageItemDesignIntf* page)
m_printer->setPaperSize(pageSize,QPrinter::Millimeter);
} else {
m_printer->setFullPage(page->fullPage());
m_printer->setPageMargins(0,0,0,0, QPrinter::Millimeter);
m_printer->setOrientation(static_cast<QPrinter::Orientation>(page->pageOrientation()));
if (page->pageSize()==PageItemDesignIntf::Custom){
QSizeF pageSize = (page->pageOrientation()==PageItemDesignIntf::Landscape)?