diff options
author | dougb <dougb@FreeBSD.org> | 2003-06-02 00:02:25 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2003-06-02 00:02:25 +0000 |
commit | e11b91add8f19c257893e117ab61fa7ced8fc5c3 (patch) | |
tree | a1860cd499655c1a7bbaf5c68778c2c95fc93a51 /print/hpijs | |
parent | bebe6b4359015d46d6e4680c9becc6227f4e9d96 (diff) | |
download | FreeBSD-ports-e11b91add8f19c257893e117ab61fa7ced8fc5c3.zip FreeBSD-ports-e11b91add8f19c257893e117ab61fa7ced8fc5c3.tar.gz |
Add working examples of a printcap and input filter for use with this port.
Diffstat (limited to 'print/hpijs')
-rw-r--r-- | print/hpijs/files/ifhp | 79 | ||||
-rw-r--r-- | print/hpijs/files/printcap.sample | 9 |
2 files changed, 88 insertions, 0 deletions
diff --git a/print/hpijs/files/ifhp b/print/hpijs/files/ifhp new file mode 100644 index 0000000..413ca87 --- /dev/null +++ b/print/hpijs/files/ifhp @@ -0,0 +1,79 @@ +#!/bin/sh + +# Please see detailed copyright below. + +PATH=/bin +export PATH + +# This is the input filter that I use for my HP Deskjet 960c. +# If you are using a different model, you will have to change +# the -sDeviceModel= parameter below. You will probably also +# want to change some of the other parameters. I have the +# options set for the highest quality output my printer will +# do with this driver. I use the ghostscript-afpl port, but +# this should work equally well with other types of gs. +# +# To use this, copy it into a handy location (the sample printcap +# file in this directory assumes /usr/local/etc/bin/), adjust +# /etc/printcap accordingly, adjust any settings below, start or +# restart lpd, and start printing! +# +# For more information, check out the handbook section on printing: +# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing.html + +# Send a reset, then Treat LF as CR+LF: +# +printf "\033E\033&k2G" || exit 2 + +# Read first line of the file to determine type of input +# +read first_line + +case "${first_line}" in +\%\!*) + # + # PostScript input, so use ghostscript and hpijs + # + /usr/local/bin/gs -q -dNOPAUSE -dSAFER -r600x600 \ + -sDEVICE=ijs -sIjsServer=/usr/local/bin/hpijs -dIjsUseOutputFD \ + -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="DESKJET 960" \ + -sIjsParams="Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2" \ + -sOutputFile=- - && exit 0 + ;; +*) + # + # 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\033E" && exit 0 + ;; +esac + +# Should not be reached +exit 2 + + +# Copyright (c) 2003 The FreeBSD Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + diff --git a/print/hpijs/files/printcap.sample b/print/hpijs/files/printcap.sample new file mode 100644 index 0000000..a2166c4 --- /dev/null +++ b/print/hpijs/files/printcap.sample @@ -0,0 +1,9 @@ + +# This is a sample printcap file suitable for use with the ifhp +# input filter. It assumes that you are using the first USB print +# device. If not, adjust lp= accordingly. + +lp:\ + :sh:\ + :lp=/dev/ulpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\ + :mx#0:if=/usr/local/etc/bin/ifhp: |