From owner-freebsd-questions Sat Sep 27 02:54:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA14916 for questions-outgoing; Sat, 27 Sep 1997 02:54:47 -0700 (PDT) Received: from htsa.htsa.hva.nl (htsa.htsa.hva.nl [145.92.3.33]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA14911 for ; Sat, 27 Sep 1997 02:54:44 -0700 (PDT) Received: from htsa.hva.nl (asd10-11.dial.xs4all.nl) by htsa.htsa.hva.nl with ESMTP (1.39.111.2/16.2) id AA269404076; Sat, 27 Sep 1997 11:54:36 +0200 Message-Id: <342CD85D.97E6E239@htsa.hva.nl> Date: Sat, 27 Sep 1997 11:56:46 +0200 From: Robin Huiser Reply-To: robinh@htsa.hva.nl X-Mailer: Mozilla 4.02b7 [en] (X11; I; FreeBSD 2.2.2-RELEASE i386) Mime-Version: 1.0 To: Antonio Bemfica Cc: FreeBSD Questions Mailing List Subject: Re: printer References: Content-Type: multipart/mixed; boundary="------------CFDD3672F9F396DC2CFA1DBF" Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk This is a multi-part message in MIME format. --------------CFDD3672F9F396DC2CFA1DBF Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Antonio Bemfica wrote: > Hi > > I once tried the scheme you suggested for printing Postscript and text to > HP Deskjets, but somehow whenever I send a ps file it would crash my > server! Your if-deskjet script looked slightly different, so I tried it > again, but it still crashes - I've compiled a newer version of Ghostscript > (5.03) but it still doesn't work. Any clues as to what could be causing > this? The job gets sent to the printer, and it starts printing allright, > but by the middle of the first page, poof! the machine invariably crashes > (Fatal trap 12: page fault while in kernel mode). But text-only jobs > prints fine! > > Antonio Hello Antonio, Wow, you have a problem over there! (Are you sure you are running FreeBSD in stead of Linux? ;-) ) I want to point out a few important things: * Use Alladin postscript * Check your lpt driver (polling or irq mode) * Use the follwing scripts, they work fine for me, and I am using FreeBSD 2.2.2 Please let me know if this works! Greets, -- Robin Huiser ,,, (o o) ()========================oOO==(_)==OOo==========================() Robin Huiser, student Computer Science HVA Faculteit Electrotechniek & Informatica, The Netherlands E-mail: robinh@htsa.hva.nl Important Unix command: echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc --------------CFDD3672F9F396DC2CFA1DBF Content-Type: text/plain; charset=us-ascii; name="printcap" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="printcap" # @(#)printcap 5.3 (Berkeley) 6/30/90 #lp|local line printer:\ # :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: deskjet|lp|HP Deskjet 694-C bubblejet printer:\ :sh:sd=/var/spool/lpd/deskjet:lp=/dev/lpt0:mx#0:\ :if=/usr/local/libexec/if-deskjet: star|STAR LC24-10 Multifont lineprinter:\ :sh:sd=/var/spool/lpd/star:lp=:rm=odie:rp=star: --------------CFDD3672F9F396DC2CFA1DBF Content-Type: text/plain; charset=us-ascii; name="if-deskjet" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="if-deskjet" #!/bin/sh # # if-hp - Postscript level 3 and text input filter for lpd # Installed in /usr/local/libexec/if-hp # # Textmode: simply copies stdin to stdout. Ignores all filter arguments # Postscript: run gs to convert the text you want to print # Add a formfeed after each job # # Some handy functions # fatal() { echo "$@" 1>\&2 exit 2 } # # Set LF to LF+CR # printf "\033\&k2G" || fatal "Cannot initialize printer" # # Read first two characters of the file # read first_line first_two_chars=`expr "$first_line" : '\(..\)'` if [ "$first_two_chars" = '%!' ]; then # # It's postscript; use Ghostscript to scan-convert and print it # /usr/local/bin/gs -dSAFER -dNOPAUSE -sPAPERSIZE=a4 -q -sDEVICE=cdj550 -sOutputFile=- - && exit 0 else # # Plan text or HP/PCL. so just print it directly; print a form # at the end to eject the last page # echo $first_line && cat && printf "\f" && exit 0 || exit 2 fi exit 2 --------------CFDD3672F9F396DC2CFA1DBF--