Include print-color-mode in attributes to be removed
...when printing via raster format
This commit is contained in:
parent
76abb7cea5
commit
5419ec2c30
3 changed files with 11 additions and 8 deletions
|
@ -26,9 +26,9 @@ Page {
|
||||||
|
|
||||||
ConfigurationValue
|
ConfigurationValue
|
||||||
{
|
{
|
||||||
id: removeDuplexAttributesForRaster
|
id: removeRedundantAttributesForRaster
|
||||||
key: "/apps/harbour-seaprint/settings/remove_duplex_attribute_for_raster"
|
key: "/apps/harbour-seaprint/settings/remove_redundant_attributes_for_raster"
|
||||||
defaultValue: false
|
defaultValue: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
@ -48,7 +48,7 @@ Page {
|
||||||
pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer},
|
pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer},
|
||||||
PageStackAction.Immediate)
|
PageStackAction.Immediate)
|
||||||
printer.print(jobParams, page.selectedFile,
|
printer.print(jobParams, page.selectedFile,
|
||||||
alwaysConvert.value, forceIncluDeDocumentFormat.value, removeDuplexAttributesForRaster.value)
|
alwaysConvert.value, forceIncluDeDocumentFormat.value, removeRedundantAttributesForRaster.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,10 +298,10 @@ QString targetFormatIfAuto(QString documentFormat, QString mimeType, QJsonArray
|
||||||
}
|
}
|
||||||
|
|
||||||
void IppPrinter::print(QJsonObject attrs, QString filename,
|
void IppPrinter::print(QJsonObject attrs, QString filename,
|
||||||
bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeDuplexAttributesForRaster)
|
bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeRedundantAttributesForRaster)
|
||||||
{
|
{
|
||||||
qDebug() << "printing" << filename << attrs
|
qDebug() << "printing" << filename << attrs
|
||||||
<< alwaysConvert << forceIncluDeDocumentFormat << removeDuplexAttributesForRaster;
|
<< alwaysConvert << forceIncluDeDocumentFormat << removeRedundantAttributesForRaster;
|
||||||
|
|
||||||
_progress = "";
|
_progress = "";
|
||||||
emit progressChanged();
|
emit progressChanged();
|
||||||
|
@ -392,11 +392,14 @@ void IppPrinter::print(QJsonObject attrs, QString filename,
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Sides = getAttrOrDefault(attrs, "sides").toString();
|
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("sides");
|
||||||
|
attrs.remove("print-color-mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "Final job attributes:" << attrs;
|
||||||
|
|
||||||
IppMsg job = IppMsg(o, attrs);
|
IppMsg job = IppMsg(o, attrs);
|
||||||
QByteArray contents = job.encode(IppMsg::PrintJob);
|
QByteArray contents = job.encode(IppMsg::PrintJob);
|
||||||
// Always convert images to get resizing
|
// Always convert images to get resizing
|
||||||
|
|
|
@ -56,7 +56,7 @@ signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void print(QJsonObject attrs, QString file,
|
void print(QJsonObject attrs, QString file,
|
||||||
bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeDuplexAttributesForRaster);
|
bool alwaysConvert, bool forceIncluDeDocumentFormat, bool removeRedundantAttributesForRaster);
|
||||||
|
|
||||||
|
|
||||||
void onUrlChanged();
|
void onUrlChanged();
|
||||||
|
|
Loading…
Reference in a new issue