1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## pjl-duplex-binding.dpatch by <till.kamppeter@gmail.com>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: https://bugs.launchpad.net/hplip/+bug/244295
8 diff -urNad hplip-2.8.7~/prnt/hpijs/ljcolor.cpp hplip-2.8.7/prnt/hpijs/ljcolor.cpp
9 --- hplip-2.8.7~/prnt/hpijs/ljcolor.cpp 2008-07-30 18:44:30.000000000 +0200
10 +++ hplip-2.8.7/prnt/hpijs/ljcolor.cpp 2008-09-23 13:17:01.000000000 +0200
13 err = thePrinter->Send ((const BYTE *) res, strlen (res));
17 + strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
19 +#ifdef APDK_AUTODUPLEX
20 + if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
22 + strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
26 + err = thePrinter->Send ((const BYTE *) res, strlen (res));
29 err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));
31 diff -urNad hplip-2.8.7~/prnt/hpijs/ljjetready.cpp hplip-2.8.7/prnt/hpijs/ljjetready.cpp
32 --- hplip-2.8.7~/prnt/hpijs/ljjetready.cpp 2008-07-30 18:44:30.000000000 +0200
33 +++ hplip-2.8.7/prnt/hpijs/ljjetready.cpp 2008-09-23 13:17:01.000000000 +0200
35 err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
38 + // Send the Binding command
39 + strcpy (szScratchStr, "@PJL SET BINDING=LONGEDGE\015\012");
40 +#ifdef APDK_AUTODUPLEX
41 + if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
43 + strcpy (szScratchStr, "@PJL SET BINDING=SHORTEDGE\015\012");
46 + err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
49 //Set the resolution to 600
50 err = thePrinter->Send ((const BYTE*)ccpPJLSetRes,sizeof(ccpPJLSetRes));
52 diff -urNad hplip-2.8.7~/prnt/hpijs/ljmono.cpp hplip-2.8.7/prnt/hpijs/ljmono.cpp
53 --- hplip-2.8.7~/prnt/hpijs/ljmono.cpp 2008-07-30 18:44:30.000000000 +0200
54 +++ hplip-2.8.7/prnt/hpijs/ljmono.cpp 2008-09-23 13:17:01.000000000 +0200
56 err = thePrinter->Send ((const BYTE *) res, strlen (res));
61 + strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
63 +#ifdef APDK_AUTODUPLEX
64 + if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
66 + strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
69 + err = thePrinter->Send ((const BYTE *) res, strlen (res));
72 err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));