diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp
index 77dd51a..0b2906f 100644
--- a/src/ippprinter.cpp
+++ b/src/ippprinter.cpp
@@ -541,7 +541,7 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
QJsonObject o = opAttrs();
o.insert("job-name", QJsonObject {{"tag", IppMsg::NameWithoutLanguage}, {"value", fileinfo.fileName()}});
- QString PaperSize = getAttrOrDefault(jobAttrs, "media").toString();
+ Params.paperSizeName = getAttrOrDefault(jobAttrs, "media").toString(Params.paperSizeName.c_str()).toStdString();
QString targetFormat = getAttrOrDefault(jobAttrs, "document-format").toString();
qDebug() << "target format:" << targetFormat;
@@ -573,18 +573,17 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
}
}
-
if(jobAttrs.contains("media-col") && jobAttrs.contains("media"))
{
- qDebug() << "moving media to media-col" << PaperSize;
- if(!PaperSizes.contains(PaperSize))
+ qDebug() << "moving media to media-col" << Params.paperSizeName.c_str();
+ if(!PaperSizes.contains(Params.paperSizeName.c_str()))
{
- emit convertFailed(tr("Unknown document format dimensions"));
+ emit convertFailed(tr("Unsupported paper size"));
return;
}
- int x = PaperSizes[PaperSize].width()*100;
- int y = PaperSizes[PaperSize].height()*100;
+ int x = PaperSizes[Params.paperSizeName.c_str()].width()*100;
+ int y = PaperSizes[Params.paperSizeName.c_str()].height()*100;
QJsonObject Dimensions =
{{"tag", IppMsg::BeginCollection},
@@ -633,11 +632,6 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
Params.format = PrintParameters::URF;
}
- if(!PaperSizes.contains(Params.paperSizeName.c_str()))
- {
- qDebug() << "Unsupported paper size" << Params.paperSizeName.c_str();
- emit convertFailed(tr("Unsupported paper size"));
- }
QSizeF size = PaperSizes[Params.paperSizeName.c_str()];
Params.paperSizeUnits = PrintParameters::Millimeters;
Params.paperSizeW = size.width();
@@ -688,16 +682,6 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
}
else
{
- if(PaperSize == "")
- {
- PaperSize = "iso_a4_210x297mm";
- }
- else if(!PaperSizes.contains(PaperSize))
- {
- emit convertFailed(tr("Unsupported print media"));
- return;
- }
-
QString Sides = getAttrOrDefault(jobAttrs, "sides").toString();
if(Sides=="two-sided-long-edge")
diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts
index bcc5356..66bb67c 100644
--- a/translations/harbour-seaprint-de.ts
+++ b/translations/harbour-seaprint-de.ts
@@ -287,10 +287,6 @@
Öffnen der Datei fehlgeschlagen
-
-
- Nicht unterstütztes Druckmedium
-
Dateiformat konnte nicht konvertiert werden
@@ -299,10 +295,6 @@
Unbekanntes Dokumentenformat
-
-
- Unbekannte Dokumentenformat Größe
-
Vorbereiten
diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts
index 437967f..63b6bfd 100644
--- a/translations/harbour-seaprint-es.ts
+++ b/translations/harbour-seaprint-es.ts
@@ -287,10 +287,6 @@
Error al abrir archivo
-
-
- Medio impreso no soportado
-
No se puede convertir este formato de archivo
@@ -299,10 +295,6 @@
Formato de documento desconocido
-
-
- Dimensiones del formato de documento desconocido
-
Preparando
diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts
index 89a7d7c..d4d86a7 100644
--- a/translations/harbour-seaprint-fr.ts
+++ b/translations/harbour-seaprint-fr.ts
@@ -287,10 +287,6 @@
Échec de l'ouverture du fichier
-
-
- Média d'impression non supporté
-
Impossible de convertir ce format de fichier
@@ -299,10 +295,6 @@
Format de document inconnu
-
-
- Format de dimensions du document inconnu
-
En cours de préparation
diff --git a/translations/harbour-seaprint-nl.ts b/translations/harbour-seaprint-nl.ts
index fb4f95c..d28b4f9 100644
--- a/translations/harbour-seaprint-nl.ts
+++ b/translations/harbour-seaprint-nl.ts
@@ -287,10 +287,6 @@
Bestand openen mislukt
-
-
- Niet-ondersteunde afdrukmedia
-
Kan dit bestandsformaat niet converteren
@@ -299,10 +295,6 @@
Onbekend documentformaat
-
-
- Onbekende afmetingen van documentformaat
-
Voorbereiden
diff --git a/translations/harbour-seaprint-pl.ts b/translations/harbour-seaprint-pl.ts
index 322af6d..99eecb0 100644
--- a/translations/harbour-seaprint-pl.ts
+++ b/translations/harbour-seaprint-pl.ts
@@ -287,18 +287,10 @@
-
-
-
-
-
-
-
-
diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts
index bc127a9..eb0dcc8 100644
--- a/translations/harbour-seaprint-zh_CN.ts
+++ b/translations/harbour-seaprint-zh_CN.ts
@@ -287,10 +287,6 @@
打开文件失败
-
-
- 不支持打印媒体文件
-
无法转换此文件格式
@@ -299,10 +295,6 @@
未知文档格式
-
-
- 未知稳定格式尺寸
-