freebsd at edvax.de
Sat Jan 9 13:35:02 UTC 2016
On Sat, 9 Jan 2016 13:28:29 +0100, Bernt Hansson wrote:
> I have a question about laserjet printers that support HPGL.
> How do one switch from ps/pcl/pjl to hpgl the code for doing so under
> dos is Ec%#B where # is 0 or 1.
> But how to do that with a print filter?
Understand the printer filter basically as a program that
reads from standard input, does some magic, and writes to
standard output. The input "language" usually is PS, and
the output will be redirected to where the printer will
accept actual input - a network address, a parallel port,
a file, whatever. But as part of the magic, the program
can write _anything_ it desires to standard output.
Let the print filter look like this:
/usr/bin/printf "Ec%1B" || exit 2
/usr/local/bin/your_hpgl_filter -outfile - && exit 0
Depending on your experience of printer behaviour, it _might_
be needed to code
to add a DOS-like line break (CR _and_ LF) if the printer should
require it. Test this if needed.
Of course you can switch back by coding
at a later step, for example if you want to combine HP-GL with PCL
or PS (if the printer should support that).
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions