From owner-freebsd-chat Tue Apr 28 01:01:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA18327 for freebsd-chat-outgoing; Tue, 28 Apr 1998 01:01:39 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from current.gaffaneys.com (dialup2.gaffaneys.com [208.155.161.52]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA18276 for ; Tue, 28 Apr 1998 01:01:30 -0700 (PDT) (envelope-from zach@gaffaneys.com) Received: (from zach@localhost) by current.gaffaneys.com (8.8.8/8.8.8) id DAA17638; Tue, 28 Apr 1998 03:02:27 -0500 (CDT) (envelope-from zach) Message-ID: <19980428030226.36517@gaffaneys.com> Date: Tue, 28 Apr 1998 03:02:26 -0500 From: Zach Heilig To: Lanny Baron Cc: freebsd-chat@FreeBSD.ORG Subject: Re: Printing (can't get it right) References: <199804272220.RAA01509@dyson.iquest.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: ; from Lanny Baron on Tue, Apr 28, 1998 at 12:41:38AM -0400 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Apr 28, 1998 at 12:41:38AM -0400, Lanny Baron wrote: > To answer your question as to whether or not I have used the printer with > another OS. Yes. With NT and 95. Using or trying to use the printer with > FreeBSD, only prints a a few words, > then a few more words, > then a few more. > > If you get the picture. One problem for sure is I don't know if the > printer is ghostscript or postscript (or even what those are :-(. I don't > blame FreeBSD (the OS or the marvelous minds attached to FreeBSD), I blame > myself for the lack of understanding Unix. You want either an input filter to add CR's, or some method of telling the printer that lines end with only NL, not CR NL. For example, here is my input filter for HP deskjet 890: (if you just want to print postscript files, install the ghostscript package, and check 'gs -?' for a cannon driver that resembles the printer you have). #!/bin/sh # # if-djet890: a filter to print plain files or postscript files # DPI=600 # Change this to your desired initialization string for the printer # mode you want. This does (for HP 800 series): # ESC & k 2 G : CR->CR, LF->CR+LF, FF->CR+FF # ESC & s 0 C : Turn on line wrap. # ESC & l 0 O : Portrait orientation. # ESC & l 2 A : US Letter sized paper. # ESC ( s 0 P : Fixed width characters. # ESC ( s 3 T : Courier typeface. printf "\033&k2G\033&s0C\033&l0O\033&l2A\033(s0P\033(s3T" read first_line first_two_chars=`expr "$first_line" : '\(..\)'` first_six_chars=`expr "$first_line" : '\(......\)'` if [ "$first_two_chars" = "%!" ]; then (echo $first_line && cat && printf "\f") | \ /usr/local/bin/gs -r$DPI -dSAFER -dNOPAUSE -q -sDEVICE=cdj850 \ -sOutputFile=- - && \ exit 0 elif [ "$first_six_chars" = "x T ps" ]; then (echo $first_line && cat && printf "\f") | \ /usr/bin/grops | \ /usr/local/bin/gs -r$DPI -dSAFER -dNOPAUSE -q -sDEVICE=cdj850 \ -sOutputFile=- - && \ exit 0 else (echo $first_line && cat && printf "\f") && \ exit 0 fi exit 2 # END /etc/printcap should look something like: lp:HP DeskJet 890C:\ :sh:\ :sd=/var/spool/lpd/djet890:\ :lp=/dev/lpt0:\ :lf=/var/log/djet890.log:\ :if=/usr/local/libexec/lp/if-djet890: This will take plain text (perhaps binary files, haven't tried), postscript, and 'zcat /usr/share/man/man5/printcap.5.gz | eqn | tbl | pic | troff -man | lpr' type lines. -- Zach Heilig -- zach@gaffaneys.com Real Programs don't use shared text. Otherwise, how can they use functions for scratch space after they are finished calling them? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message