From owner-freebsd-questions Fri Sep 26 04:32:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA29547 for questions-outgoing; Fri, 26 Sep 1997 04:32:21 -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 EAA29539 for ; Fri, 26 Sep 1997 04:32:15 -0700 (PDT) Received: from htsa.hva.nl (asd01-11.dial.xs4all.nl) by htsa.htsa.hva.nl with ESMTP (1.39.111.2/16.2) id AA170633508; Fri, 26 Sep 1997 13:31:48 +0200 Message-Id: <342B9D61.46244E25@htsa.hva.nl> Date: Fri, 26 Sep 1997 13:32:57 +0200 From: Robin Huiser X-Mailer: Mozilla 4.02b7 [en] (X11; I; FreeBSD 2.2.2-RELEASE i386) Mime-Version: 1.0 To: Doug Lo , robinh@htsa.htsa.hva.nl, FreeBSD Questions Mailing List Subject: Re: printer References: <199709242157.HAA25783@smmcroute.smmc.qld.edu.au> <19970924195634.48713@my.domain> <342A31D8.5ECDCE4F@htsa.hva.nl> <342AA45A.E31E5B3B@ms11.hinet.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Doug Lo wrote: > Robin, > > I'm using HP 690c. but I can't print postscript files. when I type lpr xxx.ps, it > still prints > "plain text". Would you tell me how to solve it? > > Thanks in advance, > Doug. Hello Doug! If you want to print postscript jobs on your HP 690c you have to install a printer filter which detects what kind of data you are sending to the printer (eg. postscript, plain text, etc...) When you try to print postscript with [lpr xxx.ps] make sure that the first line of the postscript-file contains : %!PS. Make sure you have the following write/exec permissions for the filter: -r-xr-xr-x 1 root wheel - 946 Aug 12 11:08 if-deskjet and the Alladin Ghostscript package installed! Script and printcap file: First create in /etc/printcap the following line: 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: * It tells FreeBSD that you have a printer connected to /dev/lpt0 (LPT1). * Your spool-directory is /var/spool/lpd/deskjet (CREATE IT!!!) * Because postscript jobs are sometimes of a very *LARGE*,size (For example if you print a picture with xv), I have set the mx-field to 0. (No size limits when printing a job). * The filter is in /usr/local/libexec/if-deskjet (CREATE IT!!!) Filter: if-deskjet -- BEGIN HERE -- #!/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 -sOutpu tFile=- - && 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 -- CUT HERE -- Well, if you have any questions, you know where to find me! Greets, -- Robin Huiser ,,, (o o) ()========================oOO==(_)==OOo==========================() Robin Huiser HVA Faculteit Electrotechniek & Informatica E-mail: robinh@htsa.hva.nl Important Unix command: echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc