Printing a QWebPage to PDF



  • Is it possible to print a web page (via QPrinter) as one long PDF (i.e. without pagination)? I don't see a way to do this currently. I've tried setting different page sizes and even custom paper sizes and nothing seems to work. Here's what I'm currently trying (where mPage is a QWebPage):

    @ QPrinter printer(QPrinter::HighResolution);
    printer.setPaperSize(QSizeF(750, 100000), QPrinter::DevicePixel);
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setFullPage(true);
    printer.setOutputFileName(mFilename);

    mPage.mainFrame()->print(&printer);@

    Any ideas?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.