mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-24 04:33:24 +00:00
Add working examples of a printcap and input filter for use with this port.
This commit is contained in:
parent
81d654ea08
commit
6b8eb9e06f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=81949
79
print/hpijs/files/ifhp
Normal file
79
print/hpijs/files/ifhp
Normal file
@ -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.
|
||||
|
9
print/hpijs/files/printcap.sample
Normal file
9
print/hpijs/files/printcap.sample
Normal file
@ -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:
|
Loading…
Reference in New Issue
Block a user