From owner-freebsd-questions@FreeBSD.ORG Wed Jul 27 19:51:51 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD524106566B for ; Wed, 27 Jul 2011 19:51:51 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 74BD38FC15 for ; Wed, 27 Jul 2011 19:51:51 +0000 (UTC) Received: by gyf3 with SMTP id 3so1691810gyf.13 for ; Wed, 27 Jul 2011 12:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=VHklK8Pgn8p+x6RkWXSRR+/wOFH57z5FF7tNBtHrL20=; b=fHfuA0VnZK74KRbw1ky+74LjIRjl+i+ZIdCaYllXDpEWSONOUOfp2/urg7mROl+6kj FkCpV9FIZP2SuXQdOWqr5Y2JxHt87bvWocGBxTu5ViGP/744y0Z2IgP9Vp1BAIeiAqWW cWXXsk9z9bx4QlH7kqvc4VMm8MBjmMQAWC7rU= MIME-Version: 1.0 Received: by 10.42.29.129 with SMTP id r1mr145937icc.360.1311796310507; Wed, 27 Jul 2011 12:51:50 -0700 (PDT) Received: by 10.42.169.73 with HTTP; Wed, 27 Jul 2011 12:51:50 -0700 (PDT) Date: Wed, 27 Jul 2011 14:51:50 -0500 Message-ID: From: Antonio Olivares To: FreeBSD Questions Content-Type: text/plain; charset=ISO-8859-1 Subject: printing to a HP Deskjet 812C printer 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: Wed, 27 Jul 2011 19:51:51 -0000 Dear folks, I have a working installation 8.2 Release AMD64 and I am trying to follow a printing howto : http://www.wonkity.com/~wblock/docs/html/lpdprinting.html I am copying the settings and I can't print. quadcore# lpq -a lp: Warning: no daemon present Rank Owner Job Files Total Size 1st root 0 (standard input) 17 bytes 2nd root 1 (standard input) 89 bytes quadcore# lpd chkprintcap: Warning: blanks after trailing '\', at line 62 (entry lp) chkprintcap: Warning: values-line after line with NO trailing '\', at line 63 chkprintcap: 2 warnings from skimming /etc/printcap quadcore# cat /etc/printcap # @(#)printcap 5.3 (Berkeley) 6/30/90 # $FreeBSD: src/etc/printcap,v 1.14.30.1.6.1 2010/12/21 17:09:25 kensmith Exp $ # # This enables a simple local "raw" printer, hooked up to the first # parallel port. No kind of filtering is done, so everything you pass # to the "lpr" command will be printed unmodified. # # Remember, for further print queues you're going to add, you have # to choose different spool directories (the "sd" capability below), # otherwise you will greatly confuse lpd. # # For some advanced printing, have a look at the "apsfilter" package. # It plugs into the lpd system, allowing you to print a variety of # different file types by converting everything to PostScript(tm) # format. For more information about apsfilter visit # # http://www.apsfilter.org/ # # If you don't have a PostScript(tm) printer, don't panic, but do # also install the latest "ghostscript" package for best printer support. # # Do also refer to the "printing" section of the handbook. # # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing.html # # A local copy can be found under # # /usr/share/doc/handbook/handbook.{html,latin1}. # # Banner pages are now suppressed by default. Remove the :sh: capability # to turn them back on. # #lp|local line printer:\ # :sh:\ # :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: # # Sample remote printer. The physical printer is on machine "lphost". # You can perform any kind of local filtering directly. If you need # local filters (e.g. LF -> CR-LF conversion for HP printers), create # a filter script that sends the proper escape sequence to the printer # and then concatenates stdin to stdout. # #remote|sample remote printer:\ # :sh:\ # :rm=lphost:sd=/var/spool/output/lphost:lf=/var/log/lpd-errs:\ # :if=/usr/local/libexec/if-script: # # Simple Russian printer with hardware CP866 character set, output filter # used for KOI8-R -> CP866 conversion # #lp|Russian local line printer:\ # :sh:of=/usr/libexec/lpr/ru/koi2alt:\ # :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: # add for HP Deskjet 812C lp:\ :lp=/dev/ulpt0:\ :sh:\ :mx#0:\ :sd=/var/spool/lpd/lp:\ :if=/usr/local/libexec/psif:\ :lf=/var/log/lpd-errs: quadcore# cat /usr/local/libexec/ps2pcl #!/bin/sh /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=deskjet -sOUTFILE=- - quadcore# ls -l /usr/local/libexec/ps2pcl -rwxr-xr-x 1 root wheel 81 Jul 27 14:18 /usr/local/libexec/ps2pcl quadcore# cat /usr/local/libexec/psif #!/bin/sh IFS="" read -r first_line first_two_chars=`expr "$first_line" : '\(..\)'` case "first_two_chars" in %!|\033%%) # %! or ESC% : Postscript job, print it. echo "$first_line" && cat && printf "\004" && exit 0 exit 2 ;; *) # otherwise, format with enscript ( echo "$first_line"; cat ) \ | /usr/local/bin/enscript -o - && printf "\004" && exit 0 exit 2 ;; esac quadcore# ls -l /usr/local/libexec/psif -rwxr-xr-x 1 root wheel 378 Jul 27 14:26 /usr/local/libexec/psif I modified the -sDEVICE to -sDEVICE=deskjet since the machine is an Desjet. The printer is on a USB and it is connected. I have tried to change /dev/ulpt0 and /dev/unlpt0 and still get the same thing. Any pointers/advice/hints? Thanks in Advance, Antonio