fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
402 stars 151 forks source link

big problem when a 400 pages report export to pdf ,the PDF file is very big(60M) and long time #406

Open liufeijin opened 1 year ago

liufeijin commented 1 year ago

when export a big report LimeReport will make a big file and cost long tiem. So i want to reduce down resolution when save to PDF like below image

but there is no any QPdfWriter class and QtPdf in LimeReport , so i can't do the change. Cloud anybody give me some instruction ?

liufeijin commented 1 year ago

i search on web and get below tips

QPrinter printer(QPrinter::HighResolution); qreal resolutionFactor = 1200 / printer->resolution(); QPainter painter; painter.begin(&printer); painter.scale(1 / resolutionFactor, 1 / resolutionFactor); printPage(&painter); // This method should implement printing itself painter.end();

seems use painter.scale to reduce down print out size. but i can't find the place where to be added in Limreport.

this is no effect. must be change the pdf printer driver.

liufeijin commented 1 year ago

@fralx i ask the pdf resolution problem on qt forum Somebody give me answer , change to use image will can reduce down the pdf size by setresolution. but saw your code all are use printer, cloud you make a branch to use QPainter?