From owner-freebsd-questions@FreeBSD.ORG Thu May 22 07:32:03 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC15337B401 for ; Thu, 22 May 2003 07:32:02 -0700 (PDT) Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3ADF43F3F for ; Thu, 22 May 2003 07:32:01 -0700 (PDT) (envelope-from tollallenamensindbelegt@t-online.de) Received: from fwd01.sul.t-online.de by mailout09.sul.t-online.com with smtp id 19Ir6t-0003Et-0A; Thu, 22 May 2003 16:31:59 +0200 Received: from lisa.home.net (520078630340-0001@[80.144.17.175]) by fwd01.sul.t-online.com with esmtp id 19Ir6f-1RuRRwC; Thu, 22 May 2003 16:31:45 +0200 Received: (from mib@localhost) by lisa.home.net (8.12.6p2/8.12.6/Submit) id h4MEcqH2025880 for freebsd-questions@freebsd.org; Thu, 22 May 2003 16:38:52 +0200 (CEST) Date: Thu, 22 May 2003 16:38:52 +0200 From: tollallenamensindbelegt@t-online.de To: freebsd-questions@freebsd.org Message-ID: <20030522143851.GA729@lisa.home.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Sender: 520078630340-0001@t-dialin.net Subject: can't print postscript files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 14:32:03 -0000 Hi I, had configure my /etc/printcap like the example in the freebsd handbook but I'm not able to print postscript files I thing I have a little misstake in the gs section in this script /usr/local/libexec/hl7x0 because I can print plaintext files. my printer is a brother HL-730 could any one give me the answer where is the misstake that I'm not able to print ps file. thanks!!! best regards Michael Bohn mailto: tollallenamensindbelegt@t-online.de /etc/printcap # lp|brother730:\ :sh:sd=/var/spool/lpd/brother730:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/hl7x0:\ :df=/usr/local/libexec/psdf: # ################################################################# #!/bin/sh # # ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500 # Installed in /usr/local/libexec/hl7x0 # # Treat LF as CR+LF: # printf "\033&k2G" || exit 2 # # 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. # # Note that PostScript files are actually interpreted programs, # and those programs are allowed to write to stdout, which will # mess up the printed output. So, we redirect stdout to stderr # and then make descriptor 3 go to stdout, and have Ghostscript # write its output there. Exercise for the clever reader: # capture the stderr output from Ghostscript and mail it back to # the user originating the print job. # exec 3>&1 1>&2 /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=hl7x0 \ -sOutputFile=/dev/lpt0 - && 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 && printf "\033&l0H" && exit 0 fi exit 2 ########################################################################### bash-2.05b# cd /var/spool/lpd bash-2.05b# ls -l total 14 -rw-r----x 1 daemon daemon 4 22 Mai 15:07 .seq drwxr-xr-x 2 daemon daemon 1024 22 Mai 16:08 brother730 -rw-rw-r-- 1 daemon daemon 25 22 Mai 15:07 lock drwxr-xr-x 2 daemon daemon 512 21 Mai 12:42 lp -rw-rw-r-- 1 daemon daemon 27 22 Mai 15:07 status ############################################################################ bash-2.05b# pwd /usr/local/libexec bash-2.05b# ls -la total 2732 drwxr-xr-x 7 root wheel 512 21 Mai 13:38 . drwxr-xr-x 15 root wheel 512 16 Mai 23:27 .. drwxr-xr-x 2 root wheel 512 16 Mai 21:26 autoconf213 drwxr-xr-x 2 root wheel 512 16 Mai 21:26 automake14 drwxr-xr-x 6 root wheel 512 16 Mai 20:08 cups drwxr-xr-x 3 root wheel 512 16 Mai 20:51 emacs -r-xr-xr-x 1 root wheel 18492 3 Jan 13:17 grmt -r-xr-xr-x 1 root wheel 1205 22 Mai 16:20 hl7x00 -r-xr-xr-x 1 root wheel 196 21 Mai 12:47 if-simple -r-xr-xr-x 1 root wheel 15460 21 Mai 13:37 lprps -r-xr-xr-x 1 root wheel 2699888 17 Mai 07:27 mysqld -r-xr-xr-x 1 root wheel 64 22 Mai 15:06 necp6-iso-filter -r-xr-xr-x 1 root wheel 199 21 Mai 13:22 psdf -r-xr-xr-x 1 root wheel 4832 21 Mai 13:37 psif -r-xr-xr-x 1 root wheel 42 21 Mai 13:37 psif-ps -r-xr-xr-x 1 root wheel 66 21 Mai 13:37 psif-text -r-xr-xr-x 1 root wheel 7396 21 Mai 13:37 psof drwxr-xr-x 2 root wheel 512 16 Mai 20:04 w3m bash-2.05b# ################################################################################