rastertohp: Send duplex OFF command if not desired #3131

Closed
michaelrsweet opened this Issue Mar 15, 2009 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Mar 15, 2009

Version: 1.3.9
CUPS.org User: rhstone

On the HP LaserJet 5SI/MX, you can enable duplexing by default on the printer itself. This sets the default mode if no other duplexing instructions are sent. This is very useful when communicating directly with the printer.

However, when you want to disable duplexing, CUPS should send a command to explicitly set the value to OFF when not wanted. This is a patch to modify rastertohp.c to do just that.

Note: This should be tested on other printer models to verify it does not create problems. It works great on my printer--the page per minute speed jumps through the roof when the paper bypasses the duplexing mechanism!

Collaborator

michaelrsweet commented Mar 16, 2009

"rastertohp.patch":

--- cups-1.3.9/filter/rastertohp.c 2008-07-11 15:48:49.000000000 -0700
+++ rastertohp.c 2009-03-15 09:43:31.168180054 -0700
@@ -244,9 +244,12 @@

 if (!ppd || ppd->model_number != 2)
 {
  •  if (header->Duplex)
    
  •  if (header->Duplex) {
    

    printf("\033&l%dS", /* Set duplex mode */
    header->Duplex + header->Tumble);

  •  } else {
    
  • printf("\033&l0S"); /* Turn off duplex mode */

  •  }
    

    printf("\033&l0L"); /* Turn off perforation skip */
    }

Collaborator

michaelrsweet commented Mar 16, 2009

"str3131.patch":

Index: filter/rastertohp.c

--- filter/rastertohp.c (revision 8444)
+++ filter/rastertohp.c (working copy)
@@ -4,7 +4,7 @@

  • Hewlett-Packard Page Control Language filter for the Common UNIX
  • Printing System (CUPS).
  • * Copyright 2007-2008 by Apple Inc.
  • * Copyright 2007-2009 by Apple Inc.
  • Copyright 1993-2007 by Easy Software Products.
  • These coded instructions, statements, and computer programs are the
    @@ -249,10 +249,9 @@

if (!ppd || ppd->model_number != 2)
{

  •  if (header->Duplex)
    
  • printf("\033&l%dS", /* Set duplex mode */
  •           header->Duplex + header->Tumble);
    
  •  int mode = Duplex ? 1 + header->Tumble != 0 : 0;
    
  •  printf("\033&l%dS", mode);       /\* Set duplex mode _/
    
    printf("\033&l0L"); /_ Turn off perforation skip */
    }
    }
Collaborator

michaelrsweet commented Mar 16, 2009

CUPS.org User: mike

Fixed in Subversion repository.

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment