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

QPrinter::setPaperSize() -> Inverted values for custom paper size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.0 Beta1
    • 4.8.6, 5.1.1
    • GUI: Printing
    • None
    • Linux

    Description

      I'm working on a database modeling tool and when printing huge models the user have the option to configure a custom paper size. The problem comes here: If the he setup a paper size (width x height) like 6000 x 4500 (in pixels) when printing to a PDF file the pages have the dimension inverted: 4500 x 6000.

      So in the code I have to explicitly invert the values like this:

      printer->setPaperSize(QSizeF(page_size.height(), page_size.width()), QPrinter::DevicePixel);

      I've reviewed the entire printing code and the problem only occurs with custom page sizes.

      The attached images shows the problem. The first (pdf_ok) is the result after invert the page size coordinates and the second image is the original result (without invert). Note, in the second one, the blank space at bottom.

      Attachments

        1. pdf_ok.png
          pdf_ok.png
          433 kB
        2. pdf_wrong.png
          pdf_wrong.png
          283 kB
        3. qtbug33645.tgz
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            johnlayt John Layt
            rkhaotix Raphael A. Silva
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes