On Fri, Jul 21, 2017 at 08:18:32AM +0800, Paul Goyette wrote: > > # For plain-text files: > > printf "\033&k2G" || exit 2 > > The magicfilter sends "\033E\033&k2G\033(0N" as a prefix, and "\033E" as > suffix - I have no idea what any of this means! :) I tried to use your > prefix but still no output on the printer.
I'm learning the fascinating world of PCL. apparently this is: ESC E Reset printer ESC &k2G Set line terminators to CR=CR, LF=CR+LF, FF=CR+FF ESC (0N Primary Symbol Set: ECMA-94 Latin 1 Also it says: Printers that support PJL (Laserjet 4 and later) should be told to use PCL should be entered via the PJL ENTER LANGUAGE command. That is, without escapes: @PJL ENTER LANGUAGE = PCL <CR> <LF> Also things talking about PCL6 talk about an additional header after: Stream Header (Section 7, page 201) which for ASCII would be ' HP PCL-XL;2;0 or for an older printer you might use ' HP PCL-XL;1;1 The first character of that line specifies "Binding Format" which can be: "'" ASCII, ")" Binary (little endian) or "(" Binary (big endian). The single quote tells the printer that you want to send ASCII commands rather than Binary. Also stating that not all printers do ASCII Examples: http://www.piclist.com/techref/language/pcl/lj1686.htm PCL codes: http://stanislavs.org/helppc/laserjet.html Bit about PCL6: http://www.piclist.com/techref/language/pcl/6.htm