I need to print a webpage but the painter/webpage doesn’t zoom properly: only the tables lines are zoomed and the text remain small.
Here is the code:
void InmatriculareWindow::preparePrinter(QWebPage &page, QSize size)
{
QPainter painter(m_printer);
page.setViewportSize(size);
double xscale = m_printer->pageRect().width()/double(size.width());
double yscale = m_printer->pageRect().height()/double(size.height());
double scale = qMin(xscale, yscale);
painter.scale(scale, scale);
page.mainFrame()->render(&painter);
}
And here is the ouput:
!http://i.imgur.com/cTazamU.jpg()!
↧