Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with printing if "windows scaling" > 100%
QtWS25 Last Chance

Problem with printing if "windows scaling" > 100%

Scheduled Pinned Locked Moved Solved General and Desktop
qprinterwindows 10
3 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • XardasX Offline
    XardasX Offline
    Xardas
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • XardasX Offline
      XardasX Offline
      Xardas
      wrote on last edited by
      #2

      Any advices?

      1 Reply Last reply
      0
      • XardasX Offline
        XardasX Offline
        Xardas
        wrote on last edited by
        #3

        solution

        	QApplication::setAttribute(Qt::AA_Use96Dpi);
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved