Qt输出多页 pdf
2. 代码
c
QFile pdfFile("./tmp.pdf");
pdfFile.open(QIODevice::WriteOnly);
QPdfWriter *pPdfWriter = new QPdfWriter(&pdfFile);
pPdfWriter->setResolution(300);
pPdfWriter->setPageSize(QPageSize(QPageSize::A4));
pPdfWriter->setPageMargins(QMarginsF(30, 30, 30, 30));
//绘制第一页
...
//新建页面, 第二页
pPdfWriter->newPage();
//绘制第二页
...