Hi all,
where can I find an example how to generate an encapsulated postscript file with QPainter?
I don't want to print it via print dialog. I'm looking for a as simple as possible solution to write a file direct to the drive.
Thanks
dexli
Printable View
Hi all,
where can I find an example how to generate an encapsulated postscript file with QPainter?
I don't want to print it via print dialog. I'm looking for a as simple as possible solution to write a file direct to the drive.
Thanks
dexli
You use the QPainter class. There is an outputFormat for PS.
Just a quick copy paste from a project of mine. you will need to adapt that, obviously.Code:
printer.setOutputFileName(m_currentTopic+".ps"); qreal xmargin = contentRect.width()*0.01; qreal ymargin = contentRect.height()*0.01; QPainter painter; painter.begin(&printer); painter.end();
Joh
But it seems to be a good start.:oQuote:
Just a quick copy paste from a project of mine. you will need to adapt that, obviously.
But as far as i can see there is no feature which produces eps. Is there a trick to get eps ??:confused:
Thanks
Dexli
No, the postscript output is printer oriented not as a graphics file format.
Ghostscript has the ability to do this conversion using a perl script and the bundled utilities.
Curiously similar question to this: http://www.qtcentre.org/threads/4039...ration-with-QT
Are you and netterfield the same person or do you just have the same homework assignment?
That is true, but than i also can generate eg. a Xfig format file and use fig2dev. I think it is not so much work to add a eps to the printformat because there are only 2 differences. The bounding box and the showpage command.
The showpage command can maybe easily removed from the ps file after creation, but the comoutation of the bounding box might be tricky.
Nope! definetiey not the same person. I'm a newbe regarding QT and C++ and try to lern both with a small report generator project. For this I have to generate some sketches. At the moment I use Perl to write a xfig file and than convert it to eps to import it in M$Wörg