diff --git a/src/convertworker.cpp b/src/convertworker.cpp index dc3dee2..da082e7 100644 --- a/src/convertworker.cpp +++ b/src/convertworker.cpp @@ -35,15 +35,12 @@ void ConvertWorker::convertPdf(QNetworkRequest request, QString filename, QTempo bool urf, quint32 Colors, quint32 Quality, QString PaperSize, quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble) { - if(urf) + if(urf && (HwResX != HwResY)) { // URF only supports symmetric resolutions - if(HwResX < HwResY) - { - HwResY = HwResX; - } - else { - HwResX = HwResY; - } + qDebug() << "Unsupported URF resolution" << PaperSize; + tempfile->deleteLater(); + emit failed(tr("Unsupported resolution (dpi)")); + return; } QString ShortPaperSize; @@ -147,6 +144,14 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem bool urf, quint32 Colors, quint32 Quality, QString PaperSize, quint32 HwResX, quint32 HwResY) { + if(urf && (HwResX != HwResY)) + { // URF only supports symmetric resolutions + qDebug() << "Unsupported URF resolution" << PaperSize; + tempfile->deleteLater(); + emit failed(tr("Unsupported resolution (dpi)")); + return; + } + if(!PaperSizes.contains(PaperSize)) { qDebug() << "Unsupported paper size" << PaperSize; diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 51c7426..ff17c05 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -319,6 +319,23 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert){ quint32 HwResX = PrinterResolutionRef.toObject()["x"].toInt(); quint32 HwResY = PrinterResolutionRef.toObject()["y"].toInt(); + if(target == UrfConvert) + { // Ensure symmetric resolution for URF + if(HwResX < HwResY) + { + HwResY = HwResX; + } + else + { + HwResX = HwResY; + } + QJsonObject tmpObj; + tmpObj["units"] = PrinterResolutionRef.toObject()["units"]; + tmpObj["x"] = (int)HwResX; + tmpObj["y"] = (int)HwResY; + attrs["printer-resolution"] = tmpObj; + } + quint32 Quality = getAttrOrDefault(attrs, "print-quality").toInt(); QString PrintColorMode = getAttrOrDefault(attrs, "print-color-mode").toString(); diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index 86bc120..c36357f 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -136,6 +136,10 @@ Unsupported paper size + + Unsupported resolution (dpi) + + CoverPage diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index 539425a..46aeab8 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -136,6 +136,10 @@ Unsupported paper size + + Unsupported resolution (dpi) + + CoverPage diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index 7e68313..b112229 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -136,6 +136,10 @@ Unsupported paper size + + Unsupported resolution (dpi) + + CoverPage diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index 51da42c..8a119d9 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -136,6 +136,10 @@ Unsupported paper size + + Unsupported resolution (dpi) + + CoverPage diff --git a/translations/harbour-seaprint.ts b/translations/harbour-seaprint.ts index 8813510..a01287e 100644 --- a/translations/harbour-seaprint.ts +++ b/translations/harbour-seaprint.ts @@ -136,6 +136,10 @@ Unsupported paper size + + Unsupported resolution (dpi) + + CoverPage