From d7b22d732912bdc971b04d31a89083a9bce06657 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Wed, 10 Mar 2021 20:27:45 +0100 Subject: [PATCH] libcupsfilters: Made driverless PPD generator more reliable for print or fax PPD --- NEWS | 2 ++ cupsfilters/ppdgenerator.c | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 042c20645..b1e22ab62 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ NEWS - OpenPrinting CUPS Filters v1.27.5 - 2020-06-05 CHANGES IN V2.0.0 + - libcupsfilters: Made check whether the driverless PPD to + generate should be a fax out PPD more reliable (Issue #343). - foomatic-rip: Options in the 5th command line argument of the CUPS filter command line are separated only by white space and not by comma, also make sure that an option "none" diff --git a/cupsfilters/ppdgenerator.c b/cupsfilters/ppdgenerator.c index 8fc06aa9c..3f8c9d58f 100644 --- a/cupsfilters/ppdgenerator.c +++ b/cupsfilters/ppdgenerator.c @@ -1682,9 +1682,18 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */ cupsFilePuts(fp, "*PCFileName: \"drvless.ppd\"\n"); if ((attr = ippFindAttribute(response, "ipp-features-supported", - IPP_TAG_KEYWORD))!= NULL && + IPP_TAG_KEYWORD)) != NULL && ippContainsString(attr, "faxout")) - is_fax = 1; + { + attr = ippFindAttribute(response, "printer-uri-supported", + IPP_TAG_URI); + if (attr) + { + ippAttributeString(attr, buf, sizeof(buf)); + if (strcasestr(buf, "faxout")) + is_fax = 1; + } + } if ((attr = ippFindAttribute(response, "printer-make-and-model", IPP_TAG_TEXT)) != NULL) @@ -4224,12 +4233,13 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */ free(max_res); snprintf(ppdgenerator_msg, sizeof(ppdgenerator_msg), - "%s PPD generated.", - (is_pdf ? "PDF" : + "%s %sPPD generated.", + (is_apple ? "Apple Raster" : (is_pwg ? "PWG Raster" : - (is_apple ? "Apple Raster" : + (is_pdf ? "PDF" : (is_pclm ? "PCLm" : - "Legacy IPP printer"))))); + "Legacy IPP printer")))), + (is_fax ? "Fax " : "")); cupsFileClose(fp); if (printer_opt_strings_catalog) -- 2.47.3