Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liufeijin opened this issue Jul 23, 2022 · 2 comments

Comments

@liufeijin
Copy link
Contributor

liufeijin commented Jul 23, 2022

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
Copy link
Contributor Author

liufeijin commented Jul 24, 2022

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
Copy link
Contributor Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant