Skip to content

Commit

Permalink
Ignore non-support of copies if the printer supports raster
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Mar 2, 2024
1 parent 7033563 commit ee783ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/ippprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ List<std::string> IppPrinter::possibleInputFormats()
return Converter::instance().possibleInputFormats(documentFormats() += additionalDocumentFormats());
}

bool IppPrinter::supportsPrinterRaster()
{
List<std::string> formats = documentFormats();
return formats.contains(MiniMime::PWG) || formats.contains(MiniMime::URF);
}

int IppPrinter::Supply::getPercent() const
{
return (level*100.0)/(highLevel != 0 ? highLevel : 100);
Expand Down
1 change: 1 addition & 0 deletions lib/ippprinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class IppPrinter
List<std::string> documentFormats();
List<std::string> additionalDocumentFormats();
List<std::string> possibleInputFormats();
bool supportsPrinterRaster();

bool identifySupported();
Error identify();
Expand Down
2 changes: 1 addition & 1 deletion utils/ippclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ int main(int argc, char** argv)
job.pageRanges.set(ippPageRanges);
}

set_or_fail(copiesOpt, job.copies, copies, force);
set_or_fail(copiesOpt, job.copies, copies, force || printer.supportsPrinterRaster());
set_or_fail(collatedCopiesOpt, job.multipleDocumentHandling, collatedCopies, force);
set_or_fail(paperSizeOpt, job.media, paperSize, force);

Expand Down

0 comments on commit ee783ec

Please sign in to comment.