Update printAllPDF to print a PDF that complies with PDF/A-1b

More details can be found under: https://www.kdab.com/creating-pdfa-documents-qt/
This commit is contained in:
Tobias Falk
2023-06-15 15:28:12 +02:00
committed by WandererFan
parent 4b562b0082
commit 348ecf9b56

View File

@@ -507,6 +507,8 @@ void MDIViewPage::printAllPdf(QPrinter* printer, App::Document* doc)
QString outputFile = printer->outputFileName();
QString documentName = QString::fromUtf8(doc->getName());
QPdfWriter pdfWriter(outputFile);
// setPdfVersion sets the printied PDF Version to comply with PDF/A-1b, more details under: https://www.kdab.com/creating-pdfa-documents-qt/
pdfWriter.setPdfVersion(QPagedPaintDevice::PdfVersion_A1b);
pdfWriter.setTitle(documentName);
pdfWriter.setResolution(printer->resolution());
QPainter painter(&pdfWriter);