Results 1 to 4 of 4

Thread: Qt Printing on .ps

  1. #1
    Join Date
    Jan 2006
    Location
    La Spezia,Italy
    Posts
    77
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt Printing on .ps

    Hello,I have some problems with Qt when I try to pring on a .ps file. I tryed two approachs but I had some little problems with both of them.

    The first:
    -I created a QPrinter and a QPainter on IT.
    -I draw something on the printer and then I call end() on the painter.
    -I call once more begin() on the painter to continue drawing and the problem is that the QPrinter starts drawing in another page... How can I avoid this?

    The second:
    To avoid the problem told before I:
    -Created a QPainter on a QPixmap.
    -Drawn my things on the pixmap.
    -Created a QPainter on the QPrinter and drawn directly the QPixmap.
    The problem with this method is that the quality of the resulting .ps file is worst (very) of the first method.

    With both methods I used the same configuration for my QPrinter:
    QPrinter *PSPrinter = new QPrinter(QPrinter::ScreenResolution);
    PSPrinter->setOrientation(QPrinter::Landscape);
    PSPrinter->setPageSize(QPrinter::A5);
    PSPrinter->setFullPage(TRUE);
    PSPrinter->setOutputFileName(saveFileName);

    Suggestions?

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Printing on .ps

    Quote Originally Posted by vratojr
    -I draw something on the printer and then I call end() on the painter.
    -I call once more begin() on the painter to continue drawing and the problem is that the QPrinter starts drawing in another page... How can I avoid this?
    Why do you call QPainter::end()?

  3. #3
    Join Date
    Jan 2006
    Location
    La Spezia,Italy
    Posts
    77
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Printing on .ps

    Because I have to pass the painter to other widgets to draw. If I dont' kill the painter before passing it to other widgets I got a strange problem (see my other post: http://www.qtcentre.org/forum/showthread.php?t=145 )

  4. #4
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Printing on .ps

    I have the same problem when rendering to QPicture:
    - Onscreen display is fine but the resulting printout's quality is very bad.
    - I use windows and printing to PDFCreator and "Microsoft Office Document Image Writer"
    Derick Schoonbee

Similar Threads

  1. Printing txt file vs Printing pdf file
    By rmagro in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2012, 15:45
  2. Qt4 poor printing performance
    By seneca in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2009, 14:23
  3. Safe checking the QPrinter::PrintState after printing
    By mSergey in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2008, 16:37
  4. Printing problem in windows
    By joseph in forum Qt Programming
    Replies: 6
    Last Post: 12th July 2007, 08:04
  5. Replies: 0
    Last Post: 28th June 2006, 20:49

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.