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:
p.setFullPage(true);
p.setResolution(300);
QPrintPreviewDialog preview(&p);
preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
connect(&preview,
SIGNAL(paintRequested
(QPrinter*)),
this,
SLOT(printPreview
(QPrinter*)));
preview.exec();
...
ui->myWebView->print(printer);
}
QPrinter p;
p.setPaperSize(QPrinter::A4);
p.setFullPage(true);
p.setResolution(300);
p.setOrientation(QPrinter::Portrait);
QPrintPreviewDialog preview(&p);
preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
connect(&preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printPreview(QPrinter*)));
preview.exec();
...
void printPreview(QPrinter *printer) {
ui->myWebView->print(printer);
}
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:
p.setFullPage(true);
p.setResolution(300);
QPrintPreviewDialog preview(&p);
preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
connect(&preview,
SIGNAL(paintRequested
(QPrinter*)), ui
->myWebView,
SLOT(print
(QPrinter*)));
preview.exec();
QPrinter p;
p.setPaperSize(QPrinter::A4);
p.setFullPage(true);
p.setResolution(300);
p.setOrientation(QPrinter::Portrait);
QPrintPreviewDialog preview(&p);
preview.setWindowTitle(ui->myWebView->page()->mainFrame()->title());
connect(&preview, SIGNAL(paintRequested(QPrinter*)), ui->myWebView, SLOT(print(QPrinter*)));
preview.exec();
To copy to clipboard, switch view to plain text mode
But the error persists.
How to solve? Thanks.
Bookmarks