-1
QTextDocument *td = new QTextDocument();
td->setHtml("<p>blah blah blah </p>");
QPrinter printer;
printer.setOutputFormat(QPrinter:: PdfFormat);
printer.setOrientation(QPrinter::Portrait);
printer.setPaperSize(QPrinter::Letter);
printer.setOutputFileName(filenamer);
td->print(&printer);

Permission to write files are good. QPrinter prints pdf from images in other code I have. But HTML in a QTextDocument doesn't work. Doesn anyone know why? I use Cascades as my GUI.

Dave
  • 17
  • 4

1 Answers1

0

When I run your code on version 10.2.1 simulator the call to td->print(&printer) results in the error message QPainter::begin(): Returned false.

I suspect that this is because Cascades, while derived from Qt is an extension of Qt so not all Qt facilities work. Font rendering to a QPainter is one of the things that doesn't work. This is probably the issue you have run into.

Richard
  • 8,920
  • 2
  • 18
  • 24