summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-09-28 11:16:02 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-09-28 11:16:02 -0400
commitfe1fac1444beb5e4829acd84367a478b38f7f088 (patch)
tree33a8315fbcf65d4f1c4a3335a8fda30ecfeef539
parentb485551a771de42fed4b5dfe7c749e899a691d07 (diff)
downloadcups-fe1fac1444beb5e4829acd84367a478b38f7f088.tar.gz
Support face-up printers (Issue #5345)
-rw-r--r--CHANGES.md4
-rw-r--r--cups/ppd-cache.c29
2 files changed, 32 insertions, 1 deletions
diff --git a/CHANGES.md b/CHANGES.md
index e14a20858..a259ddbeb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,4 +1,4 @@
-CHANGES - 2.2.9 - 2018-09-18
+CHANGES - 2.2.9 - 2018-09-28
============================
@@ -16,6 +16,8 @@ Changes in CUPS v2.2.9
- Fixed a crash bug in the Epson dot matrix driver (Issue #5323)
- Automatic debug logging of job errors did not work with systemd (Issue #5337)
- The web interface did not list the IPP Everywhere "driver" (Issue #5338)
+- The IPP Everywhere "driver" now properly supports face-up printers
+ (Issue #5345)
- Fixed some typos in the label printer drivers (Issue #5350)
- The IPP Everywhere "driver" no longer does local filtering when printing to
a shared CUPS printer (Issue #5361)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index 38d8998e7..6f8e6dc60 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3790,6 +3790,12 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((attr = ippFindAttribute(response, "output-bin-supported", IPP_TAG_ZERO)) != NULL && (count = ippGetCount(attr)) > 1)
{
+ ipp_attribute_t *trays = ippFindAttribute(response, "printer-output-tray", IPP_TAG_STRING);
+ /* printer-output-tray attribute, if any */
+ const char *tray_ptr; /* printer-output-tray value */
+ int tray_len; /* Len of printer-output-tray value */
+ char tray[IPP_MAX_OCTETSTRING];
+ /* printer-output-tray string value */
static const char * const output_bins[][2] =
{ /* "output-bin" strings */
{ "auto", _("Automatic") },
@@ -3840,6 +3846,11 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePrintf(fp, "*OpenUI *OutputBin: PickOne\n"
"*OrderDependency: 10 AnySetup *OutputBin\n"
"*DefaultOutputBin: %s\n", ppdname);
+ if (!strcmp(ppdname, "FaceUp"))
+ cupsFilePuts(fp, "*DefaultOutputOrder: Reverse\n");
+ else
+ cupsFilePuts(fp, "*DefaultOutputOrder: Normal\n");
+
for (i = 0; i < (int)(sizeof(output_bins) / sizeof(output_bins[0])); i ++)
{
if (!ippContainsString(attr, output_bins[i][0]))
@@ -3849,6 +3860,24 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePrintf(fp, "*OutputBin %s: \"\"\n", ppdname);
cupsFilePrintf(fp, "*%s.OutputBin %s/%s: \"\"\n", lang->language, ppdname, _cupsLangString(lang, output_bins[i][1]));
+
+ if ((tray_ptr = ippGetOctetString(trays, i, &tray_len)) != NULL)
+ {
+ if (tray_len >= (int)sizeof(tray))
+ tray_len = (int)sizeof(tray) - 1;
+
+ memcpy(tray, tray_ptr, tray_len);
+ tray[tray_len] = '\0';
+
+ if (strstr(tray, "stackingorder=lastToFirst;"))
+ cupsFilePrintf(fp, "*PageStackOrder %s: Reverse\n", ppdname);
+ else
+ cupsFilePrintf(fp, "*PageStackOrder %s: Normal\n", ppdname);
+ }
+ else if (!strcmp(ppdname, "FaceUp"))
+ cupsFilePrintf(fp, "*PageStackOrder %s: Reverse\n", ppdname);
+ else
+ cupsFilePrintf(fp, "*PageStackOrder %s: Normal\n", ppdname);
}
cupsFilePuts(fp, "*CloseUI: *OutputBin\n");
}