Bug#2558: HP-4m handling not robust enough for shared environment
Package: magicfilter
Version: 1.1b-2
The distributed magic filter for the HP-4m laserjet isn't robust
enough for a shared environment. It is susceptable to any transient
configuration from previous print jobs, and it may leave the printer
in a non-default state for the next print job. Both of these can
result in corrupted jobs for someone.
This is particularly noticable when job types are mixed.
The HP-4m defines the sequence ESC % - 1 2 3 4 5 X as the "universal
exit language" sequence. This can be used to solve all these problems
(including situations where the print job switches languages before
completing).
Here's how I've patched my copy of this filter. Basically, I've
bracketted all output with this sequence [it doesn't hurt to send it
several times in a row]. I haven't tested all the permutations, but
it works for the obvious cases.
--- /usr/doc/magicfilter/filters/ljet4m-filter Mon Jan 22 17:33:20 1996
+++ /usr/local/lib/filters/ljet4m-magic Sat Mar 16 19:48:34 1996
@@ -1,4 +1,4 @@
-#! /usr/bin/magicfilter
+#!/usr/sbin/magicfilter
#
# Magic filter setup file for 600 DPI LaserJet 4 series with PostScript
# (i.e. LJ 4MP, 4M, 4M+, 4MV or 4SiMX, or 4P, 4, 4+, 4V or 4Si with
@@ -8,7 +8,8 @@
#
# PostScript files: send to printer
-0 %! postscript
+# include exitlang sequence to avoid problems with other jobs
+0 %! text "\e%-12345X" "\004\e%-12345X"
# DVI files: convert to PostScript using dvips
0 \367\002 ffilter /usr/bin/dvips -D 600 -R -q -F -f
@@ -53,14 +54,14 @@
# PCL control codes almost always start with a "reset" and are
# usually followed by at least one additional PCL control code.
-0 \033E\033 cat
+0 \033E\033 cat "\e%-12345X" "\e%-12345X"
# PJL: Send directly to printer
-0 \033%-12345X cat
-0 "@PJL " cat
-0 @PJL\t cat
-0 @PJL\r cat
-0 @PJL\n cat
+0 \033%-12345X cat "" "\e%-12345X"
+0 "@PJL " cat "\e%-12345X" "\e%-12345X"
+0 @PJL\t cat "\e%-12345X" "\e%-12345X"
+0 @PJL\r cat "\e%-12345X" "\e%-12345X"
+0 @PJL\n cat "\e%-12345X" "\e%-12345X"
# GIF files: convert to PPM
0 GIF87a pipe /usr/bin/pbmplus/giftoppm 2>/dev/null
@@ -117,13 +118,13 @@
# wild guesses
# PCL control codes start with <ESC>
-0 \033 cat
+0 \033 cat "\e%-12345X" "\e%-12345X"
# optimistic troff magic
0 . fpipe `/usr/bin/grog -Tps $FILE`
# wacko troff magic
0 ''' fpipe `/usr/bin/grog -Tps $FILE`
# Default entry -- for normal (text) files. MUST BE LAST.
-default cat \eE\e&k2G\e(0N \eE
+default cat "\e%-12345X\eE\e&k2G\e(0N" "\e%-12345"
--
Raul
Reply to: