PDFWriter.width() = 9583
PDFWriter.height() = 13699
Karl
Added after 18 minutes:
The scaling concept helped.
Here's how I got a logo that looks appealing.
I do not want the logo to consume more than a third of the width of the page nor a fifth of height.
So I scaled using these values:
// Scaled images
quint32 iWidth = pdfWriter.width();
quint32 iHeight = pdfWriter.height();
QSize s
(iWidth
/3, iHeight
/5);
QPixmap pxScaledPic
= pxPic.
scaled(s, Qt
::KeepAspectRatio, Qt
::FastTransformation);
painter.drawPixmap(0, iYPos, pxScaledPic.width(), pxScaledPic.height(), pxScaledPic);
iYPos += pxScaledPic.height() + 250;
// Scaled images
quint32 iWidth = pdfWriter.width();
quint32 iHeight = pdfWriter.height();
QSize s(iWidth/3, iHeight/5);
QPixmap pxScaledPic = pxPic.scaled(s, Qt::KeepAspectRatio, Qt::FastTransformation);
painter.drawPixmap(0, iYPos, pxScaledPic.width(), pxScaledPic.height(), pxScaledPic);
iYPos += pxScaledPic.height() + 250;
To copy to clipboard, switch view to plain text mode
Thanks for the help.
Karl
Bookmarks