PDA

View Full Version : Printing Html -nothing in pdf output



dangerman
21st February 2010, 20:33
Hello All
I need to print out an html and I am trying something to the effect below.
I am doing anything wrong.






QString html;
html+= "<b>Hello</b> <i>Qt!</i>";

QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this);
if (printDialog.exec()) {
QPainter painter(&printer);
QTextDocument textDocument;

textDocument.setHtml(html);
textDocument.print(&printer);
}


JB

dangerman
21st February 2010, 21:55
QPainter painter(&printer); is unnecessary