You use the QPainter class. There is an outputFormat for PS.
printer.
setOutputFormat(QPrinter::PostScriptFormat);
printer.setOutputFileName(m_currentTopic+".ps");
qreal xmargin = contentRect.width()*0.01;
qreal ymargin = contentRect.height()*0.01;
printer.
setPaperSize(10*contentRect.
size()*1.02,
QPrinter::DevicePixel);
printer.
setPageMargins(xmargin,ymargin,xmargin,ymargin,
QPrinter::DevicePixel);
painter.begin(&printer);
render
(&painter,
QRectF(QPointF(0,
0),
10*contentRect.
size()),contentRect
);
painter.end();
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PostScriptFormat);
printer.setOutputFileName(m_currentTopic+".ps");
qreal xmargin = contentRect.width()*0.01;
qreal ymargin = contentRect.height()*0.01;
printer.setPaperSize(10*contentRect.size()*1.02,QPrinter::DevicePixel);
printer.setPageMargins(xmargin,ymargin,xmargin,ymargin,QPrinter::DevicePixel);
QPainter painter;
painter.begin(&printer);
render(&painter,QRectF(QPointF(0,0),10*contentRect.size()),contentRect);
painter.end();
To copy to clipboard, switch view to plain text mode
Just a quick copy paste from a project of mine. you will need to adapt that, obviously.
Joh
Bookmarks