Important: Please read the Qt Code of Conduct -

No text zooming for printing

  • 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);

    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);


    And here is the ouput:

Log in to reply