Problem with printing if "windows scaling" > 100%
Solved
General and Desktop
-
wrote on 20 Mar 2016, 16:06 last edited by
Hi, for example:
QPrinter printer(QPrinter::HighResolution); printer.setOutputFormat(QPrinter::PdfFormat); printer.setPageMargins(10, 0, 10, 0, QPrinter::Millimeter); printer.setPaperSize(QPrinter::A4); printer.setOutputFileName("testItems.pdf"); QTextDocument *doc = new QTextDocument(this); doc->documentLayout()->setPaintDevice(&printer); doc->setPageSize(QSizeF(QSize(printer.pageRect().size()))); printer.setFullPage(0); doc->print(&printer);
problem with printing result, after change "Windows display scaling" from 100%(different font size, cellspacing, etc(larger)). Any ideas how fix it?
-
wrote on 21 Mar 2016, 10:14 last edited by
Any advices?
-
wrote on 24 Mar 2016, 07:46 last edited by
solution
QApplication::setAttribute(Qt::AA_Use96Dpi);
2/3