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. Qprint poor quality...

Qprint poor quality...

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 6 Posters 2.7k 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.
  • F Offline
    F Offline
    filipdns
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      Charlie_Hdz
      wrote on last edited by
      #2

      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
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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
        0
        • O Offline
          O Offline
          ollarch
          wrote on last edited by
          #4

          Hi,

          Could you try to set the resolution to 300dpi ?

          printer.setResolution(300);
          
          F 1 Reply Last reply
          0
          • O ollarch

            Hi,

            Could you try to set the resolution to 300dpi ?

            printer.setResolution(300);
            
            F Offline
            F Offline
            filipdns
            wrote on last edited by filipdns
            #5

            @ollarch alt text
            Hello, I try, nothing changed

            1 Reply Last reply
            0
            • mrjjM mrjj

              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 Offline
              F Offline
              filipdns
              wrote on last edited by
              #6

              @mrjj hello, the image is 1024x725

              mrjjM 1 Reply Last reply
              0
              • F filipdns

                @mrjj hello, the image is 1024x725

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @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
                0
                • C Charlie_Hdz

                  Welcome @filipdns

                  Can you show drafts of each situation?

                  F Offline
                  F Offline
                  filipdns
                  wrote on last edited by filipdns
                  #8

                  @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
                  0
                  • mrjjM mrjj

                    @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 Offline
                    F Offline
                    filipdns
                    wrote on last edited by
                    #9

                    @mrjj for you what the size has to be?

                    mrjjM 1 Reply Last reply
                    0
                    • F filipdns

                      @mrjj for you what the size has to be?

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      2
                      • A Offline
                        A Offline
                        Asperamanca
                        wrote on last edited by
                        #11

                        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
                        2
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          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
                          0
                          • SGaistS SGaist

                            Hi,

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

                            F Offline
                            F Offline
                            filipdns
                            wrote on last edited by
                            #13

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

                            1 Reply Last reply
                            0

                            • Login

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