Date: Sat, 26 Aug 2000 21:51:53 +0100 From: Mark Ovens <marko@freebsd.org> To: jason <jason@welsh.dynip.com> Cc: questions@freebsd.org Subject: Re: printing text with deskjet 842 Message-ID: <20000826215153.C257@parish> In-Reply-To: <Pine.BSF.4.10.10008261519140.63042-100000@welsh.dynip.com>; from jason@welsh.dynip.com on Sat, Aug 26, 2000 at 03:25:38PM -0400 References: <Pine.BSF.4.10.10008261519140.63042-100000@welsh.dynip.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 26, 2000 at 03:25:38PM -0400, jason wrote: > I have been trying to print from my freebsd 4.0 box to this printer and > keep getting the dreaded staggered text..i.e. > !"#$%&'()*+,-./01234 > "#$%&'()*+,-./012345 > #$%&'()*+,-./0123456 > > I followed the directions in the printing section of the handbook and set > up my print filter as such > > #!/bin/sh > # > # > # Treat LF as CR+LF: > # > printf "\033&k2G" || exit 2 > If that is all your filter contains then it is probably not enough. You are not cat(1)'ing the file to be printed. Try this # # Plain text or HP/PCL, so just print it directly; print a form # at the end to eject the last page. # printf "\033&k2G" && cat && printf "\033&l0H" && exit 0 If you want to be able to print PS as well then use this filter (you'll need ghostscript installed and will probably have to change the ghostscript options, these are for an HP 610C): #!/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. Ejects the page when done. # printf "\033&k2G" && cat && printf "\033&l0H" && exit 0 # exit 2 # # Read first two characters of the file # read 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 -sPAPERSIZE=a4 -dNOPAUSE -q \ -sDEVICE=cdj550 -sOutputFile=/dev/fd/3 - && exit 0 else # # Plain text or HP/PCL, so just print it directly; print a form # at the end to eject the last page. # printf "\033&k2G" && echo $first_line && cat && \ printf "\033&l0H" && exit 0 fi exit 2 > and that file is executable. > [jason@welsh]$ ls -al /usr/local/libexec/if-simple > -r-xr-xr-x 1 root wheel 211 Aug 26 12:53 > /usr/local/libexec/if-simple > > > my /etc/printcap contains > # > lp|local line printer:\ > :sh:\ > :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: > :if=/usr/local/libexec/if-simple: > # > # Sample remote printer. The physical printer is on machine "lphost". > > > any suggestions? > > regards, > Jason > > > > -- > ======================================================================= > | Jason Welsh jason@welsh.dynip.com | If you think there's | > | | good in everybody, you | > | http://welsh.dynip.com/ | haven't met everybody. | > ======================================================================= > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- 4.4 - The number of the Beastie ________________________________________________________________ 51.44°N FreeBSD - The Power To Serve http://www.freebsd.org 2.057°W My Webpage http://ukug.uk.freebsd.org/~mark mailto:marko@freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000826215153.C257>