Hi there,

I have trouble printing a rich text document to a printer with HighResolution settings.

So far I use something in the lines of:
Qt Code:
  1. QAbstractTextDocumentLayout* layout = text.documentLayout();
  2.  
  3. QAbstractTextDocumentLayout::PaintContext context;
  4. context.palette.setColor(QPalette::Text, painter->pen().color());
  5. layout->draw(painter, context);
To copy to clipboard, switch view to plain text mode 
whereas text is a QTextDocument, and painter is a QPainter created for a printer object. The printer was initialized with QPrinter::HighResolution.

It seems that printing with high-resolution is somewhat tricky. For example, the font metrics returned have to be scaled manually to obtain a correct line spacing. And maybe that's also the reason why the draw() function of QAbstractTextDocumentLayout doesn't work as expected?

Any suggestions are welcome!
Andreas