]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/emit.c
Merge CUPS 1.4svn-r7493.
[thirdparty/cups.git] / cups / emit.c
index da76ea36e0c5f48e21a837541167805e2d6fc687..636f3e7fbb2ba021b8057b920ec3c77bf55008b8 100644 (file)
@@ -413,6 +413,7 @@ ppdEmitJCL(ppd_file_t *ppd,         /* I - PPD file record */
     */
 
     ppd_attr_t *charset;               /* PJL charset */
+    ppd_attr_t *display;               /* PJL display command */
 
 
     if ((charset = ppdFindAttr(ppd, "cupsPJLCharset", NULL)) != NULL)
@@ -421,6 +422,12 @@ ppdEmitJCL(ppd_file_t *ppd,                /* I - PPD file record */
         charset = NULL;
     }
 
+    if ((display = ppdFindAttr(ppd, "cupsPJLDisplay", NULL)) != NULL)
+    {
+      if (!display->value)
+        display = NULL;
+    }
+
     fputs("\033%-12345X@PJL\n", fp);
     for (ptr = ppd->jcl_begin + 9; *ptr;)
       if (!strncmp(ptr, "@PJL JOB", 8))
@@ -477,9 +484,16 @@ ppdEmitJCL(ppd_file_t *ppd,                /* I - PPD file record */
     * Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode...
     */
 
-    fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", temp,
-            job_id, user, temp);
-    fprintf(fp, "@PJL RDYMSG DISPLAY = \"%d %s %s\"\n", job_id, user, temp);
+    if (display && strcmp(display->value, "job"))
+    {
+      fprintf(fp, "@PJL JOB NAME = \"%s\"\n", temp);
+
+      if (display && !strcmp(display->value, "rdymsg"))
+        fprintf(fp, "@PJL RDYMSG DISPLAY = \"%d %s %s\"\n", job_id, user, temp);
+    }
+    else
+      fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", temp,
+             job_id, user, temp);
   }
   else
     fputs(ppd->jcl_begin, fp);