Include print-color-mode in attributes to be removed

...when printing via raster format
This commit is contained in:
Anton Thomasson 2020-06-06 15:16:46 +02:00
parent 76abb7cea5
commit 5419ec2c30
3 changed files with 11 additions and 8 deletions

View file

@ -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)
}
}
}

View file

@ -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

View file

@ -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();