From 276b9d2759b7ee301c539b7db885dd0d19bef9de Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sat, 13 Feb 2021 21:59:46 +0100 Subject: [PATCH] Fix Postscript printing --- qml/pages/utils.js | 10 ++++++++++ src/ippprinter.cpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/qml/pages/utils.js b/qml/pages/utils.js index bfdbd4a..746f298 100644 --- a/qml/pages/utils.js +++ b/qml/pages/utils.js @@ -260,6 +260,12 @@ function canTransferPdfAs(type) return has(targets, type) } +function canTransferPostscriptAs(type) +{ + var targets = ["application/octet-stream", "application/postscript"]; + return has(targets, type) +} + function canConvertImageTo(type) { var targets = ["application/octet-stream", "image/jpeg", "image/png", "image/pwg-raster", "image/urf", "image/gif"]; @@ -288,6 +294,10 @@ function limitChoices(name, choices, mimeType, ConvertChecker) } } + else if(mimeType == "application/postscript") + { + return choices.filter(canTransferPostscriptAs) + } else if(mimeType.indexOf("image") != -1) { return choices.filter(canConvertImageTo); diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 13fae99..16fa540 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -309,6 +309,10 @@ QString targetFormatIfAuto(QString documentFormat, QString mimeType, QJsonArray { return firstMatch(supportedMimeTypes, {"application/pdf", "application/postscript", "image/pwg-raster", "image/urf" }); } + else if(mimeType == "application/postscript") + { + return firstMatch(supportedMimeTypes, {"application/postscript"}); + } else if (mimeType.contains("image")) { QStringList ImageFormatPrioList {"image/png", "image/gif", "image/pwg-raster", "image/urf", "image/jpeg"};