Assume A4 for empty paper size, check only if needed
This commit is contained in:
parent
c932d54da1
commit
bc3c43874d
1 changed files with 10 additions and 6 deletions
|
@ -448,12 +448,6 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysUseMediaC
|
||||||
quint32 Colors = PrintColorMode.contains("color") ? 3 : PrintColorMode.contains("monochrome") ? 1 : 0;
|
quint32 Colors = PrintColorMode.contains("color") ? 3 : PrintColorMode.contains("monochrome") ? 1 : 0;
|
||||||
bool pdfPageRangeAdjustNeeded = false;
|
bool pdfPageRangeAdjustNeeded = false;
|
||||||
|
|
||||||
if(!PaperSizes.contains(PaperSize))
|
|
||||||
{
|
|
||||||
emit convertFailed(tr("Unsupported print media"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint32 PageRangeLow = 0;
|
quint32 PageRangeLow = 0;
|
||||||
quint32 PageRangeHigh = 0;
|
quint32 PageRangeHigh = 0;
|
||||||
if(attrs.contains("page-ranges"))
|
if(attrs.contains("page-ranges"))
|
||||||
|
@ -502,6 +496,16 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysUseMediaC
|
||||||
{
|
{
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
if(PaperSize == "")
|
||||||
|
{
|
||||||
|
PaperSize = "iso_a4_210x297mm";
|
||||||
|
}
|
||||||
|
else if(!PaperSizes.contains(PaperSize))
|
||||||
|
{
|
||||||
|
emit convertFailed(tr("Unsupported print media"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QTemporaryFile* tempfile = new QTemporaryFile();
|
QTemporaryFile* tempfile = new QTemporaryFile();
|
||||||
tempfile->open();
|
tempfile->open();
|
||||||
tempfile->write(contents);
|
tempfile->write(contents);
|
||||||
|
|
Loading…
Reference in a new issue