Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Sep 1998 16:51:26 -0800 (AKDT)
From:      groggy@iname.com
To:        BEAUPRE Antoine <beaupran@JSP.UMontreal.CA>
Cc:        Francisco Reyes <francisco@natserv.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: How to print plain ASCII file
Message-ID:  <Pine.BSF.3.96.980920164111.1631A-100000@abc.xyz.net>
In-Reply-To: <Pine.SGI.3.96.980920103636.24622C-100000@derby.jsp.umontreal.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

> > Is there a tutorial/source for printing simple ASCII files.

if your replaced the <CTRL> stuff with normal control
characters, and use the ghostsript command for your
particular printer, this will print DOS/UNIX text files,
as well as PostScript (Netscape HTML) pages by simply
stating "lp FILE" ...  NOTE the "if" printcap command.
hope this ends this question once and for all ;)
i got this straight from the handbook (almost).

#!/bin/sh
#
# LP Filter (PS/DOS/UNIX) ... printcap :if=usr/libexec/lpr/lpf: 1997(c)KERR

read line1

if   echo $line1 | grep -q %!; then \
     /usr/local/bin/gs -q -g2550x3250 -r300 -dBATCH -sDEVICE=djet500 \
     -sOutputFile=- - && exit 0
elif echo $line1 | grep <CTRL-M>; then \
     cat && echo <CTRL-L> && exit 0
else echo $line1<CTRL-M>; \
     cat | sed s/$/<CTRL-M>/ && echo <CTRL-L> && exit 0
fi
exit 2

# BUGS: when printing text files, a cr/lf is always printed at the top
#       of the 1st page of each document, leaving only 65 of 66 lines
#       left for printing on my djet500 (1st page only).
#       requires ghostscript for postscript printing.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980920164111.1631A-100000>