Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QT5.15.0 QWebEnginePage print function set wrong page size
Forum Updated to NodeBB v4.3 + New Features

QT5.15.0 QWebEnginePage print function set wrong page size

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 343 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    haibianren
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved