Important: Please read the Qt Code of Conduct -

QT5.15.0 QWebEnginePage print function set wrong page size

  • QT5.15.0

    We want to set custom page size when printing QWebEnginePage's content:

    QPrinter printer;
    auto pageSize = QPageSize(QSizeF(paperWidth, paperHeight), QPageSize::Millimeter);
    webViewPage.print(&printer, std::move(cb));

    if paperWidth > paperHeight, the page size is wrong, it seems relate to the issue:

    we've checked QT old versions, QT5.9.9 is OK, the page size can be set correctly. but we cannot use it, because there are many new css features not supported by QT5.9.9.

    Are there any workarounds?

Log in to reply