hplip/hplip-pjl-duplex-binding.patch
2012-02-01 15:16:03 +04:00

74 lines
2.6 KiB
Diff

#! /bin/sh /usr/share/dpatch/dpatch-run
## pjl-duplex-binding.dpatch by <till.kamppeter@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: https://bugs.launchpad.net/hplip/+bug/244295
@DPATCH@
diff -urNad hplip-2.8.7~/prnt/hpijs/ljcolor.cpp hplip-2.8.7/prnt/hpijs/ljcolor.cpp
--- hplip-2.8.7~/prnt/hpijs/ljcolor.cpp 2008-07-30 18:44:30.000000000 +0200
+++ hplip-2.8.7/prnt/hpijs/ljcolor.cpp 2008-09-23 13:17:01.000000000 +0200
@@ -325,6 +325,19 @@
err = thePrinter->Send ((const BYTE *) res, strlen (res));
+// Binding directive
+
+ strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
+
+#ifdef APDK_AUTODUPLEX
+ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
+ {
+ strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
+ }
+#endif
+
+ err = thePrinter->Send ((const BYTE *) res, strlen (res));
+
err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));
ERRCHECK;
diff -urNad hplip-2.8.7~/prnt/hpijs/ljjetready.cpp hplip-2.8.7/prnt/hpijs/ljjetready.cpp
--- hplip-2.8.7~/prnt/hpijs/ljjetready.cpp 2008-07-30 18:44:30.000000000 +0200
+++ hplip-2.8.7/prnt/hpijs/ljjetready.cpp 2008-09-23 13:17:01.000000000 +0200
@@ -324,6 +324,17 @@
err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
ERRCHECK;
+ // Send the Binding command
+ strcpy (szScratchStr, "@PJL SET BINDING=LONGEDGE\015\012");
+#ifdef APDK_AUTODUPLEX
+ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
+ {
+ strcpy (szScratchStr, "@PJL SET BINDING=SHORTEDGE\015\012");
+ }
+#endif
+ err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
+ ERRCHECK;
+
//Set the resolution to 600
err = thePrinter->Send ((const BYTE*)ccpPJLSetRes,sizeof(ccpPJLSetRes));
ERRCHECK;
diff -urNad hplip-2.8.7~/prnt/hpijs/ljmono.cpp hplip-2.8.7/prnt/hpijs/ljmono.cpp
--- hplip-2.8.7~/prnt/hpijs/ljmono.cpp 2008-07-30 18:44:30.000000000 +0200
+++ hplip-2.8.7/prnt/hpijs/ljmono.cpp 2008-09-23 13:17:01.000000000 +0200
@@ -207,6 +207,19 @@
err = thePrinter->Send ((const BYTE *) res, strlen (res));
ERRCHECK;
+// Binding directive
+
+ strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
+
+#ifdef APDK_AUTODUPLEX
+ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
+ {
+ strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
+ }
+#endif
+ err = thePrinter->Send ((const BYTE *) res, strlen (res));
+ ERRCHECK;
+
err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));
ERRCHECK;