0

i need to use Qtwebkit functions in GUI application but i do not want to view the webkit in my GUI app. the main function is to render HTML to pdf . i know i can do it with QtWebkit headless.

user63898
  • 29,839
  • 85
  • 272
  • 514

1 Answers1

1

Use QWebPage since it can work without displaying anything on the screen. Something like:

QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);

page->mainFrame->print(&printer);
Ariya Hidayat
  • 12,523
  • 3
  • 46
  • 39