Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Qprint poor quality...

    General and Desktop
    6
    13
    1986
    Loading More Posts
    • 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.
    • F
      filipdns last edited by

      Hello,

      Do you know why when I print pdf with Qprinter I got a very poor quality text?

      I try

          QPrinter printer(QPrinter::HighResolution);
          QPainter::Antialiasing;
          QPainter::TextAntialiasing;
      

      but the result is very small image and poor quality, unreadable and after I try:

         QPrinter printer(QPrinter::ScreenResolution);
          QPainter::Antialiasing;
          QPainter::TextAntialiasing;
      

      then I have the image with good size readable but the quality is bad...

      Kind regards

      1 Reply Last reply Reply Quote 0
      • C
        Charlie_Hdz last edited by

        Welcome @filipdns

        Can you show drafts of each situation?

        Kind Regards,
        Enrique Hernandez
        gearstech.com.mx
        chernandez@gearstech.com.mx

        F 1 Reply Last reply Reply Quote 1
        • mrjj
          mrjj Lifetime Qt Champion last edited by

          Hi
          When using QPrinter::HighResolution, the PDF page have many
          more pixels than when using QPrinter::ScreenResolution

          So if you have an image of say 100x100, it will become
          VERY small with HighResolution if you DO NOT scale it when you draw it.
          So you need to scale image UP as it comes in ScreenResolution size, so to speak.

          F 1 Reply Last reply Reply Quote 0
          • O
            ollarch last edited by

            Hi,

            Could you try to set the resolution to 300dpi ?

            printer.setResolution(300);
            
            F 1 Reply Last reply Reply Quote 0
            • F
              filipdns @ollarch last edited by filipdns

              @ollarch alt text
              Hello, I try, nothing changed

              1 Reply Last reply Reply Quote 0
              • F
                filipdns @mrjj last edited by

                @mrjj hello, the image is 1024x725

                mrjj 1 Reply Last reply Reply Quote 0
                • mrjj
                  mrjj Lifetime Qt Champion @filipdns last edited by

                  @filipdns
                  Ok, but in highres its 1200 DPI so it will be pretty small anyway.
                  You must scale it up when drawing to have it be that small.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    filipdns @Charlie_Hdz last edited by filipdns

                    @Charlie_Hdz
                    here the screen print: 0_1517500489764_print_screen.png

                    here with highresolution:

                    0_1517500563618_highresolution.png

                    here with screenresolution:
                    0_1517500849910_screenresolution.png

                    1 Reply Last reply Reply Quote 0
                    • F
                      filipdns @mrjj last edited by

                      @mrjj for you what the size has to be?

                      mrjj 1 Reply Last reply Reply Quote 0
                      • mrjj
                        mrjj Lifetime Qt Champion @filipdns last edited by

                        @filipdns
                        You just need to scale it up so it fits better.
                        Page is ultra much bigger in highres.

                        1 Reply Last reply Reply Quote 2
                        • A
                          Asperamanca last edited by

                          When your DPI differs from the default value for screen rendering, you need to provide this information to various Qt classes that depend on it for calculations, for example QTextLayout, QFont and QFontMetrics.

                          If you don't do this, calculated spaces will be much too small.

                          1 Reply Last reply Reply Quote 2
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            Hi,

                            Not to nitpick but did you ask OSAC for the permission to reproduce their document, even if empty, here ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            F 1 Reply Last reply Reply Quote 0
                            • F
                              filipdns @SGaist last edited by

                              @SGaist hi this document has no copyright, it is free of use on the osac website

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post