From owner-freebsd-questions@FreeBSD.ORG Sun Oct 1 00:12:14 2006 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG 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 2022916A415 for ; Sun, 1 Oct 2006 00:12:14 +0000 (UTC) (envelope-from kline@sage.thought.org) Received: from sage.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6775E43D58 for ; Sun, 1 Oct 2006 00:12:13 +0000 (GMT) (envelope-from kline@sage.thought.org) Received: from sage.thought.org (kline@localhost [127.0.0.1]) by sage.thought.org (8.13.6/8.12.10) with ESMTP id k910CA4W082464 for ; Sat, 30 Sep 2006 17:12:10 -0700 (PDT) (envelope-from kline@sage.thought.org) Received: (from kline@localhost) by sage.thought.org (8.13.6/8.13.1/Submit) id k910CAYO082463 for freebsd-questions@FreeBSD.ORG; Sat, 30 Sep 2006 17:12:10 -0700 (PDT) (envelope-from kline) Date: Sat, 30 Sep 2006 17:12:10 -0700 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20061001001210.GA82422@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing twenty years of service to the Unix community User-Agent: Mutt/1.5.13 (2006-08-11) Cc: Subject: triouble with my Deskjet 500 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2006 00:12:14 -0000 The trouble is that it only prints in ASCII Aand fails to fails to print xv images or anything else PostScript. I'm playing around withthe following in /usr//local/libexec: #!/bin/sh # # hpif - Simple text input filter for lpd for HP-PCL based printers # Installed in /usr/local/libexec/hpif # # Simply copies stdin to stdout. Ignores all filter arguments. # Tells printer to treat LF as CR+LF. Writes a form feed character # after printing job. ###printf "\033&k2G" && cat && printf "\f" && exit 0 # # ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500 # Installed in /usr/local/libexec/ifhp # # 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=djet500 \ -sOutputFile=/dev/fd/3 - && 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 It's pretty obviouslythat I can toss the first several lines that came from the originl hpif file; this was before I cared about graphics. I lost the ghostscript part when my system had its fatal trap. Anybody out there who has an ancient hp djet500? or can help otherwise. I'm out of ideas. thanks much, gary PS: I tried printing a graphic file remote; my printer spat out hex. Now I tried small graphic with xv and Print. Same thing.... . -- Gary Kline kline@thought.org www.thought.org Public service Unix