[Qt-interest] pdf printer 1200 DPI and font size

Sylvain Pointeau sylvain.pointeau at gmail.com
Sun Apr 3 22:56:14 CEST 2011


Hi,

I am actually making a proof of concept using Qt with the pdf printer.
I just want to have the logical coordinates for handling mm.

drawRect runs totally normally but what about the font size?
using setPixelSize, it seems I set the value in mm,
but not with setPointSizeF, I don't know!

     QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setPaperSize(QPrinter::A4);
    printer.setOutputFileName("../../../nonwritable.pdf");

    QPainter painter;


    if (! painter.begin(&printer)) { // failed to open file
     qWarning("failed to open file, is it writable?");
     return 1;
    }

    int LogicalWidth  = 2100;
    int LogicalHeight = 2970;
    painter.setWindow(0, 0,LogicalWidth, LogicalHeight);

Thank you,
Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110403/3488f0d8/attachment.html 


More information about the Qt-interest-old mailing list