Results 1 to 5 of 5

Thread: Image Quality when printing to PDF

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Image Quality when printing to PDF

    I am trying to see if there is a way to get better image quality when using QPrinter to print to a PDF file. Currently the image is extremely blurry at the time of printing. The type of images are typically high-resolution map images where the level of detail needs to be maintained when printing to PDF. I am currently using version 4.5.3 of QT.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Image Quality when printing to PDF

    Does setting QPrinter::HighResolution on the QPrinter change the situation?

  3. #3
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Image Quality when printing to PDF

    Setting the QPrinter to QPrinter::HighResolution just blew the whole document up to crazy sizes. Normally the document should be on a single page and with HighResolution set to became 32 pages and nothing fit on a single page.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Image Quality when printing to PDF

    How are you painting to the printer? How are you handling the logical coordinate system for the page versus the source? Pagination? For 32 pages to be generated you must be issuing QPrinter::newPage() calls that you were not issuing before.

  5. #5
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Image Quality when printing to PDF

    You were correct there was a call to QPrinter::newPage() that I was missing before. It appears that my problem is not as simple as I had initially thought it to be. I am painting to the printer using a QPainter which in turn is using a combination of QTextDocument and QPainter::drawText. The QTextDocument is written to by using QTextCursor in conjunction with QTextBlock, QTextTable, and QImage. When the QTextDocument::drawContents() call is made it seems as though that call is not applying the QPrinter resolution evenly to all of its various elements. The text within the QTextTables and QTextBlocks is not scaling appropriately for the resolution. Thanks for your help so far and hopefully now that I've learned more about the application it may provide some insight into where things are going astray?

Similar Threads

  1. Can I get better PDF quality in 4.5.x?
    By tcvw in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2010, 21:29
  2. QGraphicsScene Low Image Quality
    By nemmartins in forum Qt Programming
    Replies: 2
    Last Post: 30th March 2010, 20:19
  3. Printing Screenshot -> poor quality
    By MarcSchubert in forum Qt Programming
    Replies: 2
    Last Post: 14th May 2007, 10:48
  4. Painter greyscale, image quality paint-brush!
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 22nd March 2007, 20:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.