Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2005 12:06:06 -0700 (PDT)
From:      modelt20@canada.com
To:        wblock@wonkity.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Adding a FormFeed to an LPR printcap file?
Message-ID:  <20050529190607.29117.fh052.wm@smtp.sc0.cp.net>

next in thread | raw e-mail | index | archive | help
Hello:

Thank you for your reply. My if filter follows:
#!/bin/sh
#
# kx-p1124 - Print Ghostscript-simulated Postscript on
a Panasonic KX-P1124
# installed in /usr/local/bin/kx-p1124

#

# Read first two characters of the file
#
IFS="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
	#
	# It is Postscript; use Ghostscript to scan-convert
and print it.
	#
	/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=lj \
	-sOutputFile=- - && exit 0
else
	#
	# Plain text or HP/PCL, so just print it directly;
print a form feed
	# at the end to eject the last page.
	#
	echo "$first_line" && cat && exit 0
fi

exit 2

As you can see, there is nothing special about this. I
am suspecting I need to add a printf "0x0c" between the
last && cat and the && exit 0 just before the fi.

Thanks in advance for your help.

Harold.

On Sat, 28 May 2005 18:47:41 -0600 (MDT), Warren Block
wrote:

> 
> On Fri, 27 May 2005 modelt20@canada.com wrote:
> 
> > Could someone suggest a way to add a form feed to
the
> > end of a print document in LPR? I have a printer
that
> > doesn't eject the last page when the print job is
> > finished; and I can't seem to find this in the
manual.
> >
> > My guess is I need to add it to my printer filter,
but
> > its not clear to me what I need to add.
> 
> What printer filter do you have now?
> 
> -Warren Block * Rapid City, South Dakota USA



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050529190607.29117.fh052.wm>