diff --git a/qml/pages/PrinterPage.qml b/qml/pages/PrinterPage.qml index 8eab41d..9f0b925 100644 --- a/qml/pages/PrinterPage.qml +++ b/qml/pages/PrinterPage.qml @@ -26,9 +26,9 @@ Page { ConfigurationValue { - id: removeDuplexAttributesForRaster - key: "/apps/harbour-seaprint/settings/remove_duplex_attribute_for_raster" - defaultValue: false + id: removeRedundantAttributesForRaster + key: "/apps/harbour-seaprint/settings/remove_redundant_attributes_for_raster" + defaultValue: true } Component.onCompleted: { @@ -48,7 +48,7 @@ Page { pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer}, PageStackAction.Immediate) printer.print(jobParams, page.selectedFile, - alwaysConvert.value, forceIncluDeDocumentFormat.value, removeDuplexAttributesForRaster.value) + alwaysConvert.value, forceIncluDeDocumentFormat.value, removeRedundantAttributesForRaster.value) } } } diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 51844d2..2e65f7d 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -298,10 +298,10 @@ QString targetFormatIfAuto(QString documentFormat, QString mimeType, QJsonArray } void IppPrinter::print(QJsonObject attrs, QString filename, - bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeDuplexAttributesForRaster) + bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeRedundantAttributesForRaster) { qDebug() << "printing" << filename << attrs - << alwaysConvert << forceIncluDeDocumentFormat << removeDuplexAttributesForRaster; + << alwaysConvert << forceIncluDeDocumentFormat << removeRedundantAttributesForRaster; _progress = ""; emit progressChanged(); @@ -392,11 +392,14 @@ void IppPrinter::print(QJsonObject attrs, QString filename, } QString Sides = getAttrOrDefault(attrs, "sides").toString(); - if(removeDuplexAttributesForRaster && (documentFormat=="image/pwg-raster" || documentFormat=="image/urf")) + if(removeRedundantAttributesForRaster && (documentFormat=="image/pwg-raster" || documentFormat=="image/urf")) { attrs.remove("sides"); + attrs.remove("print-color-mode"); } + qDebug() << "Final job attributes:" << attrs; + IppMsg job = IppMsg(o, attrs); QByteArray contents = job.encode(IppMsg::PrintJob); // Always convert images to get resizing diff --git a/src/ippprinter.h b/src/ippprinter.h index 118d911..7a8ea5a 100644 --- a/src/ippprinter.h +++ b/src/ippprinter.h @@ -56,7 +56,7 @@ signals: public slots: void print(QJsonObject attrs, QString file, - bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeDuplexAttributesForRaster); + bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeRedundantAttributesForRaster); void onUrlChanged();