From beaef31c6983ccf1ea42033a8d5ced21ba75b40c Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sun, 5 Nov 2017 18:40:55 +0300 Subject: [PATCH] Fix: #90 Print to PDF does not honor page size --- limereport/lrreportengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index 87ef13b..5768951 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -292,10 +292,10 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer) QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)? QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()): renderPage.pageItem()->sizeMM(); - if (page->getSetPageSizeToPrinter()) + if (page->getSetPageSizeToPrinter() || printer.outputFormat() == QPrinter::PdfFormat) printer.setPaperSize(pageSize,QPrinter::Millimeter); } else { - if (page->getSetPageSizeToPrinter()) + if (page->getSetPageSizeToPrinter() || printer.outputFormat() == QPrinter::PdfFormat) printer.setPaperSize((QPrinter::PageSize)renderPage.pageItem()->pageSize()); } }