added PDF/A-1b compliancy to all PDF export functions

for more details about this look at: https://www.kdab.com/creating-pdfa-documents-qt/
This commit is contained in:
Tobias Falk
2023-06-27 22:57:26 +02:00
committed by Chris Hennes
parent ba1171f7c1
commit 529f9401f7
6 changed files with 14 additions and 0 deletions

View File

@@ -255,6 +255,8 @@ void SheetView::printPdf()
QString::fromLatin1("%1 (*.pdf)").arg(tr("PDF file")));
if (!filename.isEmpty()) {
QPrinter printer(QPrinter::ScreenResolution);
// setPdfVersion sets the printied PDF Version to comply with PDF/A-1b, more details under: https://www.kdab.com/creating-pdfa-documents-qt/
printer.setPdfVersion(QPagedPaintDevice::PdfVersion_A1b);
printer.setPageOrientation(QPageLayout::Landscape);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(filename);

View File

@@ -303,6 +303,8 @@ void MDIViewPage::printPdf(std::string file)
QString filename = QString::fromUtf8(file.data(), file.size());
QPrinter printer(QPrinter::HighResolution);
// setPdfVersion sets the printied PDF Version to comply with PDF/A-1b, more details under: https://www.kdab.com/creating-pdfa-documents-qt/
printer.setPdfVersion(QPagedPaintDevice::PdfVersion_A1b);
printer.setFullPage(true);
printer.setOutputFileName(filename);
@@ -513,6 +515,8 @@ void MDIViewPage::printAll(QPrinter* printer, App::Document* doc)
//static routine to print all pages in a document to pdf
void MDIViewPage::printAllPdf(QPrinter* printer, App::Document* doc)
{
// setPdfVersion sets the printied PDF Version to comply with PDF/A-1b, more details under: https://www.kdab.com/creating-pdfa-documents-qt/
printer->setPdfVersion(QPagedPaintDevice::PdfVersion_A1b);
// Base::Console().Message("MDIVP::printAllPdf()\n");
QString outputFile = printer->outputFileName();
QString documentName = QString::fromUtf8(doc->getName());