Hey everyone,
I'm trying and searching all the forums I know for days now, but I just can't find the problem with this one:
QWebView *view = new QWebView();
QString htmlPage
= "<html> ..... </html>";
view->setHtml(htmlPage);
printer.
setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setFullPage(true);
printer.
setOrientation(QPrinter::Portrait);
view->print(&printer);
QWebView *view = new QWebView();
QString htmlPage = "<html> ..... </html>";
view->setHtml(htmlPage);
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setFullPage(true);
printer.setOrientation(QPrinter::Portrait);
printer.setPaperSize(QPrinter::A4);
view->print(&printer);
QDesktopServices::openUrl(QUrl("file:///" + fileName, QUrl::TolerantMode));
To copy to clipboard, switch view to plain text mode
I'm simply trying to print an HTML-File to PDF that I previously parsed in a QWebView. The HTML should fill the whole page, which it does on the machine I'm developing on.
But on some computers I tried my application, in the PDF either fonts appear printed a lot larger or the HTML is printed in an area much smaller than the actual page.
My client is starting to get mad, cause on his computer the content only fills the uppler left quarter of the page and is too small to read...
Am I doing something wrong here? Is there some kind of relative size setting that I missed? (setResolution doesn't show an effect) How can i specify the area in which the WebView should print to?
Thank you so much for your advice, MisterIKS
Bookmarks