printing to a HP Deskjet 812C printer
Antonio Olivares
olivares14031 at gmail.com
Wed Jul 27 19:51:51 UTC 2011
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
More information about the freebsd-questions
mailing list