Unsolved Qprint poor quality...
-
Hello,
Do you know why when I print pdf with Qprinter I got a very poor quality text?
I try
QPrinter printer(QPrinter::HighResolution); QPainter::Antialiasing; QPainter::TextAntialiasing;
but the result is very small image and poor quality, unreadable and after I try:
QPrinter printer(QPrinter::ScreenResolution); QPainter::Antialiasing; QPainter::TextAntialiasing;
then I have the image with good size readable but the quality is bad...
Kind regards
-
Welcome @filipdns
Can you show drafts of each situation?
-
Hi
When using QPrinter::HighResolution, the PDF page have many
more pixels than when using QPrinter::ScreenResolutionSo if you have an image of say 100x100, it will become
VERY small with HighResolution if you DO NOT scale it when you draw it.
So you need to scale image UP as it comes in ScreenResolution size, so to speak. -
Hi,
Could you try to set the resolution to 300dpi ?
printer.setResolution(300);
-
@ollarch
Hello, I try, nothing changed -
@mrjj hello, the image is 1024x725
-
@filipdns
Ok, but in highres its 1200 DPI so it will be pretty small anyway.
You must scale it up when drawing to have it be that small. -
-
@mrjj for you what the size has to be?
-
@filipdns
You just need to scale it up so it fits better.
Page is ultra much bigger in highres. -
When your DPI differs from the default value for screen rendering, you need to provide this information to various Qt classes that depend on it for calculations, for example QTextLayout, QFont and QFontMetrics.
If you don't do this, calculated spaces will be much too small.
-
Hi,
Not to nitpick but did you ask OSAC for the permission to reproduce their document, even if empty, here ?
-
@SGaist hi this document has no copyright, it is free of use on the osac website