Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111943

QWebEngineView::print() does not handle margins properly

    XMLWordPrintable

Details

    • Windows

    Description

      When trying to print webpage to PDF using QWebEngineView::print() with all 4 margins specified, the top and left margins work correctly, but webpage is not scaled down properly so that everything is shifted toward bottom right corner. The result is bottom and right margins are abnormally small.

      Steps to reproduce the issue:
      1. Apply the attached patch to Qt official simple browser example.
      2. Run the example.
      3. File->Print and print to a PDF.
      4. It can be observed that webpage contents are shifted to lower-right corner.

      The printer is set up in tabwidget.cpp 'void TabWidget::handlePrintTriggered()'. Printer settings do not help here, e.g., setPagesize, setPageOrientation, etc. do not help solve this margin issue.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              luqiaochen Luqiao Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes