hplip/pjl-duplex-binding.dpatch
2013-08-26 10:37:49 +04:00

77 lines
2.7 KiB
Text

#! /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@
Index: hplip-3.12.4/prnt/hpijs/ljcolor.cpp
===================================================================
--- hplip-3.12.4.orig/prnt/hpijs/ljcolor.cpp 2012-04-10 18:39:32.000000000 +1000
+++ hplip-3.12.4/prnt/hpijs/ljcolor.cpp 2012-05-26 10:21:29.000000000 +1000
@@ -330,6 +330,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;
Index: hplip-3.12.4/prnt/hpijs/ljjetready.cpp
===================================================================
--- hplip-3.12.4.orig/prnt/hpijs/ljjetready.cpp 2012-04-10 18:39:32.000000000 +1000
+++ hplip-3.12.4/prnt/hpijs/ljjetready.cpp 2012-05-26 10:21:29.000000000 +1000
@@ -329,6 +329,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;
Index: hplip-3.12.4/prnt/hpijs/ljmono.cpp
===================================================================
--- hplip-3.12.4.orig/prnt/hpijs/ljmono.cpp 2012-04-10 18:39:32.000000000 +1000
+++ hplip-3.12.4/prnt/hpijs/ljmono.cpp 2012-05-26 10:21:29.000000000 +1000
@@ -212,6 +212,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;