The first page of the print out of a QWebView with small fonts and images.

Note: The error occurs in "windows 7" (not tested on other platforms)
Note: Qt5.0.2, Windows 7 64bit
The other pages are normal view a ScreenShot error:
TXCp8.jpg

Source:
Qt Code:
  1. p.setPaperSize(QPrinter::A4);
  2. p.setFullPage(true);
  3. p.setResolution(300);
  4. p.setOrientation(QPrinter::Portrait);
  5.  
  6. QPrintPreviewDialog preview(&p);
  7. preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
  8. connect(&preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printPreview(QPrinter*)));
  9. preview.exec();
  10.  
  11. ...
  12.  
  13. void printPreview(QPrinter *printer) {
  14. ui->myWebView->print(printer);
  15. }
To copy to clipboard, switch view to plain text mode 


I used QPageSetupDialog and corrected in QPrintPreviewDialog but when printing on paper the error happens again.

I also tried using this:
Qt Code:
  1. p.setPaperSize(QPrinter::A4);
  2. p.setFullPage(true);
  3. p.setResolution(300);
  4. p.setOrientation(QPrinter::Portrait);
  5.  
  6. QPrintPreviewDialog preview(&p);
  7. preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
  8. connect(&preview, SIGNAL(paintRequested(QPrinter*)), ui->myWebView, SLOT(print(QPrinter*)));
  9. preview.exec();
To copy to clipboard, switch view to plain text mode 

But the error persists.

How to solve? Thanks.