Leave page-ranges in for Postscript

This commit is contained in:
Anton Thomasson 2021-11-15 21:50:48 +01:00
parent 497f860aaf
commit e918b8784a
2 changed files with 6 additions and 3 deletions

View file

@ -115,7 +115,7 @@ Page {
tag: IppMsg.IntegerRange tag: IppMsg.IntegerRange
name: "page-ranges" name: "page-ranges"
prettyName: qsTr("Page range") 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) property var pdfpages: ConvertChecker.pdfPages(selectedFile)
high: pdfpages == 0 ? 65535 : pdfpages high: pdfpages == 0 ? 65535 : pdfpages

View file

@ -545,9 +545,12 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
QJsonObject PageRanges = getAttrOrDefault(jobAttrs, "page-ranges").toObject(); QJsonObject PageRanges = getAttrOrDefault(jobAttrs, "page-ranges").toObject();
PageRangeLow = PageRanges["low"].toInt(); PageRangeLow = PageRanges["low"].toInt();
PageRangeHigh = PageRanges["high"].toInt(); PageRangeHigh = PageRanges["high"].toInt();
// Always effected locally // Effected locally, unless it is Postscript which we cant't render
if(documentFormat != Mimer::Postscript)
{
jobAttrs.remove("page-ranges"); jobAttrs.remove("page-ranges");
} }
}
qDebug() << "Final op attributes:" << o; qDebug() << "Final op attributes:" << o;
qDebug() << "Final job attributes:" << jobAttrs; qDebug() << "Final job attributes:" << jobAttrs;