Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT5.15.0 QWebEnginePage print function set wrong page size



  • QT5.15.0
    Window10

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

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

    if paperWidth > paperHeight, the page size is wrong, it seems relate to the issue: https://bugreports.qt.io/browse/QTBUG-86820.

    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