From bc3c43874dec237b0954ba266561482918adf826 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Mon, 22 Mar 2021 18:25:30 +0100 Subject: [PATCH] Assume A4 for empty paper size, check only if needed --- src/ippprinter.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 8ef3a17..bd3702b 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -448,12 +448,6 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysUseMediaC quint32 Colors = PrintColorMode.contains("color") ? 3 : PrintColorMode.contains("monochrome") ? 1 : 0; bool pdfPageRangeAdjustNeeded = false; - if(!PaperSizes.contains(PaperSize)) - { - emit convertFailed(tr("Unsupported print media")); - return; - } - quint32 PageRangeLow = 0; quint32 PageRangeHigh = 0; if(attrs.contains("page-ranges")) @@ -502,6 +496,16 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysUseMediaC { file.close(); + if(PaperSize == "") + { + PaperSize = "iso_a4_210x297mm"; + } + else if(!PaperSizes.contains(PaperSize)) + { + emit convertFailed(tr("Unsupported print media")); + return; + } + QTemporaryFile* tempfile = new QTemporaryFile(); tempfile->open(); tempfile->write(contents);