Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 14:34:56 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Bernt Hansson <bah@bananmonarki.se>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Printer question
Message-ID:  <20160109143456.74f48f42.freebsd@edvax.de>
In-Reply-To: <5690FCED.7000401@bananmonarki.se>
References:  <5690FCED.7000401@bananmonarki.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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:

	#!/bin/sh
	/usr/bin/printf "Ec%1B" || exit 2
	/usr/local/bin/your_hpgl_filter -outfile - && exit 0
	exit 2

Depending on your experience of printer behaviour, it _might_
be needed to code 

	printf "Ec%1B\r\n"

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

	printf "Ec%0B"

at a later step, for example if you want to combine HP-GL with PCL
or PS (if the printer should support that).




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160109143456.74f48f42.freebsd>