From e918b8784a53b9a200e9c666e96244d5a9802d4f Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Mon, 15 Nov 2021 21:50:48 +0100 Subject: [PATCH] Leave page-ranges in for Postscript --- qml/pages/PrinterPage.qml | 2 +- src/ippprinter.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qml/pages/PrinterPage.qml b/qml/pages/PrinterPage.qml index df5919b..19a6b52 100644 --- a/qml/pages/PrinterPage.qml +++ b/qml/pages/PrinterPage.qml @@ -115,7 +115,7 @@ Page { tag: IppMsg.IntegerRange name: "page-ranges" prettyName: qsTr("Page range") - valid: (selectedFileType == Mimer.PDF || Mimer.isOffice(selectedFileType)) + valid: (selectedFileType == Mimer.PDF || Mimer.isOffice(selectedFileType) || (_valid && selectedFileType == Mimer.Postscript)) property var pdfpages: ConvertChecker.pdfPages(selectedFile) high: pdfpages == 0 ? 65535 : pdfpages diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 3459450..44cf809 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -545,8 +545,11 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) QJsonObject PageRanges = getAttrOrDefault(jobAttrs, "page-ranges").toObject(); PageRangeLow = PageRanges["low"].toInt(); PageRangeHigh = PageRanges["high"].toInt(); - // Always effected locally - jobAttrs.remove("page-ranges"); + // Effected locally, unless it is Postscript which we cant't render + if(documentFormat != Mimer::Postscript) + { + jobAttrs.remove("page-ranges"); + } } qDebug() << "Final op attributes:" << o;