with pdf printer.newPage() fails everytime
Trying to write a function that you pass a QStringList to, and a file name - creates a multiple page PDF - each string list holding HTML for that page.
Here is my code always creates the last page as the only page with page 1 in the corner , new page returns false every time
Code:
{
printer.
setOrientation(QPrinter::Portrait);
printer.setResolution(300);
printer.setFullPage(false);
printer.setCopyCount(1);
printer.
setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(qsFileName);
QRect Rect1
(0.0,
0.0,printer.
width(),printer.
height());
{
printer.newPage();
document.setHtml(qsPage);
document.print(&printer);
}
}
Re: with pdf printer.newPage() fails everytime
You can put one HTML page into a QTextDocument - you need to tell the HTML to parse the pages
<DIV style="page-break-after:always"></DIV>