bug-ghostscript
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU ghostscript 7.07 should send PJL SET RENDERMODE command in PCLXL dri


From: Jonathan Kamens
Subject: GNU ghostscript 7.07 should send PJL SET RENDERMODE command in PCLXL driver
Date: Thu, 3 Mar 2005 16:22:09 -0500

The PCLXL driver in ghostscript should send the PJL SET RENDERMODE
command telling the printer whether the file being printed is
grayscale or color, so the printer can choose the correct path (i.e.,
some color printers have different print paths for b&w and color print
jobs).  The patch below implements this.

  jik

--- src/gdevpxut.c.rendermode   2005-03-03 15:50:23.000000000 -0500
+++ src/gdevpxut.c      2005-03-03 16:10:40.000000000 -0500
@@ -34,8 +34,12 @@
 int
 px_write_file_header(stream *s, const gx_device *dev)
 {
+    static const char *const enter_pjl_header =
+        "address@hidden SET RENDERMODE=";
+    static const char *const rendermode_gray = "GRAYSCALE";
+    static const char *const rendermode_color = "COLOR";
     static const char *const file_header =
-       "address@hidden ENTER LANGUAGE = PCLXL\n\
+       "address@hidden ENTER LANGUAGE = PCLXL\n\
 ) HP-PCL XL;1;1;Comment Copyright Aladdin Enterprises 1996\000\n";
     static const byte stream_header[] = {
        DA(pxaUnitsPerMeasure),
@@ -47,6 +51,18 @@
        pxtOpenDataSource
     };
 
+    px_put_bytes(s, (const byte *)enter_pjl_header,
+                strlen(enter_pjl_header));
+
+    /* Should I instead check the device name against "pxlmono" and/or
+       "pxlcolor" and/or check if "color" is in the name? */
+    if (dev->color_info.depth == 8)
+       px_put_bytes(s, (const byte *)rendermode_gray,
+                    strlen(rendermode_gray));
+    else
+       px_put_bytes(s, (const byte *)rendermode_color,
+                    strlen(rendermode_color));
+
     /* We have to add 2 to the strlen because the next-to-last */
     /* character is a null. */
     px_put_bytes(s, (const byte *)file_header,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]