PDA

View Full Version : Qt Printing on .ps



vratojr
11th January 2006, 10:51
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!

jacek
11th January 2006, 12:40
-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()?

vratojr
11th January 2006, 12:45
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 )

derick
19th February 2006, 00:22
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"