The problem is the same with the use of a QWebPage class...
Here is the code:
#include <QtCore>
#include <QtGui>
#include <QtWebKit>
int main(int argc, char *argv[]) {
qPrinter
->setOutputFormat
(QPrinter::PdfFormat);
qPrinter->setOutputFileName("out.pdf");
QString text
= "<html> <body> coucou <br>coucou br>coucou <br>coucou <br>coucou <br>coucou <br>coucou </body> </html>";
QWebPage *qWebPage = new QWebPage();
qWebPage->mainFrame()->setHtml(text);
qWebPage
->setViewportSize
(QSize(2000,
2000));
qWebPage->mainFrame()->print(qPrinter);
return app.exec();
}
#include <QtCore>
#include <QtGui>
#include <QtWebKit>
int main(int argc, char *argv[]) {
QApplication app(argc, argv, 1);
QPrinter *qPrinter = new QPrinter(QPrinter::HighResolution);
qPrinter->setOutputFormat(QPrinter::PdfFormat);
qPrinter->setOutputFileName("out.pdf");
QString text = "<html> <body> coucou <br>coucou br>coucou <br>coucou <br>coucou <br>coucou <br>coucou </body> </html>";
QWebPage *qWebPage = new QWebPage();
qWebPage->mainFrame()->setHtml(text);
qWebPage->setViewportSize(QSize(2000,2000));
qWebPage->mainFrame()->print(qPrinter);
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Any idea of what I'm missing?
Best regards,
Oscar
Bookmarks