Hi Thomas, Thanks for taking a look.

I have submitted a change request, which is currently at +1 status (thanks 
Edward Wellborn)  https://codereview.qt-project.org/#/c/158402/, and after a 
few rounds we have this text:

    The units are determined by the underlying paint device. The size is
    measured in logical pixels when painting to the screen, and in points
    (1/72 inch) when painting to a printer.

I tried to add you as a reviewer, but didn’t find you in the system.   Feel 
free to add yourself as a reviewer, or comment there. 
I


Steve Schilz
PASCO scientific - think science





On 6/7/16, 7:04 AM, "Development on behalf of 
[email protected]" 
<[email protected] on behalf of 
[email protected]> wrote:
>Message: 4
>Date: Tue, 7 Jun 2016 10:26:27 +0200
>From: Thomas Krenn <[email protected]>
>To: [email protected]
>Subject: [Development] Documentation for
>       QPagedPrintDevice::setPageSize should specify a unit
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
>Hello,
>Steve Schilz requested on Wed, 4 May 2016:
>
>QPagedPrintDevice::setPageSize should specify a unit
>QTextDocument::setPageSize 
>(http://doc.qt.io/qt-5/qtextdocument.html#pageSize-prop)
>
>---
>
>Looking at the source code and the generated PDF's my conclusion is
>is that the numbers of the property pageSize dependent on the platform
>because all internal calculations of QTextDocument are done with: 
>'qt_defaultDpi'
>
>Notably on Windows (qt_defaultDpi = 96 dpi) the produced PDF is to small
>with a pageSize e.g.:
>
>fullRectPoints  595 / 842  (595,44) / (841,62)     (72 dpi / A4)
>and a PDF printer with:
>
>     QString pdfName("hello.pdf")
>     QPrinter printer(QPrinter::HighResolution);
>     printer.setOutputFormat(QPrinter::PdfFormat);
>     printer.setOutputFileName(pdfName);
>
>     printer.setResolution(1200);
>     QPageSize pageSizeA(QPageSize::A4);
>     printer.setPageSize(pageSizeA);
>
>// setting the printer margin to 0 (or full page mode) is important to avoid 
>PDF page scaling.
>     QMarginsF margins(0, 0, 0, 0);
>     printer.setPageMargins(margins);
>
>
>Best regards
>Thomas Krenn
>

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to