Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.10.1, 5.11.0
-
None
Description
Hi all,
I discovered a bug related to QtWebEnginePage / QtWebEngineView and QPrinter.
In times where Qt had QtWebView with the WebKit this combination worked very well.
Nowadays QPrinter with HighResolution will pixelate the whole PDF.
I used this minimalistic HTML:
<html><body><table><tr><th>Month</th><th>Savings</th></tr></table></body></html>
With this CPP:
void Test::Test( QObject *parent ) : QObject( parent ) { QString cHtml = "<html><body><table><tr><th>Month</th><th>Savings</th></tr></table></body></html>"; vPrinter = new QPrinter; vPrinter->setResolution(QPrinter::HighResolution); vPrinter->setPageSize(QPrinter::A4); vPrinter->setOutputFormat(QPrinter::PdfFormat); vPrinter->setOutputFileName("D:\\test.pdf"); page = new QWebEnginePage; connect( page, SIGNAL(loadFinished(bool)), this, SLOT(loaded(bool))); page->setHtml( cHtml ); } void Test::loaded( bool state ) { page->print(vPrinter, [=](bool state){ emit pdfGenerated(state); }); }
Best regards,
Mike