## The Master /etc/ifhp.conf File
## Assumes that we are generating output for a HP LaserJet Family Printer
## $Id: ifhp.conf,v 1.1.1.2 1999/09/28 04:48:11 nathanw Exp $
##
## You should define your options in a ifhp.conf file in the spool
## directory,  or use the printcap ifhp=.... entry to get the options
## Comment have ## or #-- at the start of the line
##  commented out options have only # at the start of line

#--- START debugging setup
## turn debugging on
# debug=5
## specify a specific file for output
#dev=/tmp/d
## specify a network connection
# dev=astart14%9100
## specify a serial line
# dev=/dev/ttya
#stty=38400 -echo -crmod -raw -oddp -evenp ixon pass8 -ixany cbreak

## put trace output on STDERR
# trace
## specify status file for testing
#--- END debugging setup

## The summary file really slows down operation as it requires
## a file system sync each time.  Writing to a UDP socket is very
## fast
# summaryfile=summary

## Status file location and limits in K bytes
##
# statusfile=status
statusfile_max=8
statusfile_min=2

#--- START language setup
## default is to turn everything on
pjl
pcl
ps
text@
## do CRLF translation
crlf

## These are for very ugly printers that have some strange problems
##  with PCL and PS end of job at the start of jobs.  If it is present,
##  the PJL settings are ignored,  or the rest of the job may be
##  ignored.  This also happens when you use a Microsoft product and the
##  print driver puts ^D at the start of PostScript jobs.  You have been
##  warned.
##
## Do NOT put PCL EOJ at start of job when PCL supported
# no_pcl_eoj
# 
## Do NOT put PS EOJ at start of PS when PS is being printed
# no_ps_eoj

## Some printers get very upset when PostScript jobs contain ^T or ^C
## characters.  You can remove various control character by setting
## their values in this string:
##  remove_ctrl=TC   will remove CTRL-T and CTRLC characters
##  This is only done for PostScript jobs.

remove_ctrl=TC


## Some printers insist on using the Tagged Binary Commmunication Protocol
## to support sending embedded PS file.  If you need to use TBCP, enable this.
## This flag is inherently evil,  and is for desperate uses only,
## and should not be generally enabled. 
##
## If you don't know what this is about,  don't mess with it.
##    You, as they say,  have been warned.
##
# tbcp

#--- END lanuage setup


#--- START accounting extra information
##  For those little moments of quiet desperation when you need to have the
##  actual printing filter do some accounting.  Why?  because you may need to
##  check with some specialized database,  update the information in it.
##
## Again,  this is inherently evil,  and is for desperate sysadmins who are
## trying to placate the bean counters in administration...
## If you don't know what this is about,  don't mess with it.
## You, as they say,  have been warned.  Also,  read the source code
## as well.
##

##
## accounting script
# accounting=accounting.sh
#--- END accounting extra information

#--- START printer status, sync, and pagecount
## information reporting
## status@ will suppress any reading of status information.  This can
##  have ugly side effects if your programs send status back on a TCP/IP
##  link,  it is not read,  the printers output buffer becomes full,
##  and the printer will lock up.  Use this ONLY if you must.
##  If you want the effects of status@,  but do not want to 'actively'
##  expect status back,  use sync@,pagecount@ instead
##
status

## sync@     - no sync
## sync      - if pjl availble us it, then if ps available use it
##             this is best method to sync
## sync=ps   - use ps method
## sync=pjl  - use pjl method
sync
## try sending sync at these intervals
#
sync_interval=20

## pagecount@     - no sync
## pagecount      - if pjl availble us it, then if ps available use it
##             this is best method to sync
## pagecount=ps   - use ps method
## pagecount=pjl  - use pjl method
pagecount
##  If your printer does not have a reliable way to determine that
## the last job has finished,  you can 'poll' it at intervals.
## The page count will be sampled at 'pagecount_poll' intervals
## until it is stable.
##  This is for desperation only
#pagecount_poll=5

##  You may need to periodically resend the pagecount command
## if you do not get a response.  This will do so.  You may have problems
## with jobs that take a very long time to process and which do not have
## reliable 'end of job' indications.

pagecount_interval=20

##  We will send a 'sync' query at then end of job to determine if a job has
##  finished.  However, if you do not want to do this, then set
##  waitend@ . Suppressing waitend is DANGEROUS if you expect to
##  get error status back.
waitend

## interval to send queries - this can be pretty long as many times
##  you will need to wait until the job finishes.  You do not want to
##  send too many of these
##
waitend_interval=300

## how often to report progress - minimum of percent or
##  amount written (in Kbytes)
##  report when you have done this much more percent of the job
progress_pc=25
##  report when you have done this much more Kbytes of job
progress_k=1000

#--- END printer status, sync, and pagecount

#--- START OF Banner
##  If we want to have the ifhp filter generate a banner,
##  then we need to specify what format for the banner
##  This is ugly, ugly, ugly.
##  I don't know why I did this,  given that LPRng does better
##  banners.  This may come out
#banner=ps
#banner=pcl
banner@
#banner_file=/usr/athena/lib/filters/psbanner.ps
#--- END OF Banner


## START PJL configuration

## only allow these PJL commands
##
pjl_only=[
    COMMENT DEFAULT DINQUIRE ECHO ENTER EOJ
    FSAPPEND FSDIRLIST FSQUERY FSUPLOAD FSDELETE FSDOWNLOAD FSINIT FSMKDIR
    INFO INITIALIZE INQUIRE JOB OPMSG PJL RDYMSG
    RESET SET STMSG USTATUS USTATUSOFF
## special builtins that expand variables correctly
    COPIES
 ]

## do NOT allow these PJL commands, even if they are in pjl_only
pjl_except=[ ]

## BUILTIN PJL Support
##  pjl_enter - printer supports language selection
pjl_enter
##  pjl_job -   printer supports PJL JOB 
pjl_job
##  pjl_console -   printer supports PJL console setting 
pjl_console

## expand the following on startup,  after the builtin
pjl_init=[ ustatus teoj ]

## expand the following on termination,  after the builtin
pjl_term=[ ustatus teoj ]

## You can, if you are feeling very odd, force a file
##  to be send as part of the PJL setup
##  1. add setup to pjl_user_opts if you want user specified files
##    specify this with -Tsetup=filename
##  2. put setup=filename in pjl_init=[ ... ] list
##    if you want it permanently set up
##  The setup will get expanded to font_download=filename
##    and the actual file will come from ${pjl_fontdir}/filename
##  This keeps users from downloading /etc/passwd to your printer 

pjl_fontdir=/usr/athena/lib/fonts/pjl
pjl_setup=[ font_download=\%s{setup} ]
## default value for testing or insurance
setup=test

##   PJL USTATUS command string
##    This usually will force job status to be sent at 10
##   second intervals,  which is pretty useful for a keepalive
pjl_ustatus=
    @PJL USTATUS OFF
    @PJL USTATUS JOB = ON
    @PJL USTATUS DEVICE = ON
    @PJL USTATUS PAGE = ON
    @PJL USTATUS TIMED = 10

##   If your printer has 'True End of Job'  then this is useful.
##  The TEOJ is an undocumented option for PJL that forces JOB
##  status to be delayed until the job has been totally printed.
##  Sometimes it works,  usually does not
##
pjl_teoj= @PJL TEOJ = ON


## PJL Variables supposedly supported by HP and others
##  Your milage may vary.  More may be added as time goes on
##  Note:  the pjl_vars_set += [ ... ] format may soon
##  allow additional values to be added

pjl_vars_set= [
    AUTOCONF AUTOSELECT BINDING=LONGEDGE BITSPERPIXEL CLEARABLEWARNINGS
    CONTEXTSWITCH COURIER=REGULAR CPCLOCK DENSITY DISKLOCK
    DUPLEX ECONOMODE FINISH FORMLINES=60
    IMAGEADAPT INTRAY1 INTRAY2 
    INTRAY1SIZE INTRAY2SIZE INTRAY3SIZE INTRAY4SIZE
    INTRAY5SIZE INTRAY6SIZE INTRAY7SIZE INTRAY8SIZE
    IOBUFFER IOSIZE JOBATTR JOBOFFSET
    LANG=ENGLISH LOWTONER MANUALFEED
    MEDIASOURCE MEDIATYPE MPTRAY ORIENTATION=PORTRAIT OUTBIN=UPPER
    OUTLINEPOINTSIZE PAGEPROTECT
    PAPER=LETTER PARALLEL PERSONALITY=AUTO POWERSAVE POWERSAVETIME=30
    PRINTQUALITY=NORMAL QTY=1 RENDERMODE REPRINT=AUTO RESOLUTION
    RESOURCESAVE RESOURCESIZE RET TIMEOUT=600 WIDEA4
 ]

##
## Commands we have created:  upper, lower
## PJL Options we can set: autoselect autoconf
##

pjl_user_opts=[ inupper inlower outupper duplex outlower autoselect
    autoconf transparency setup copies landscape portrait ]

## Your milage may vary on these,  but supposedly most PJL aware
## printers will either support or ignore them
##

pjl_inupper=@PJL SET MEDIASOURCE = TRAY1
pjl_inlower=@PJL SET MEDIASOURCE = TRAY2
pjl_outupper=@PJL SET OUTBIN = UPPER
pjl_outlower=@PJL SET OUTBIN = LOWER
pjl_copies=@PJL SET COPIES = \%{copies}
pjl_transparency=@PJL SET MEDIATYPE = TRANSPARENCY
pjl_landscape=@PJL SET ORIENTATION = LANDSCAPE
pjl_portrait=@PJL SET ORIENTATION = PORTRAIT

## PJL USTATUS information will include a lot of
## codes that are just not interesting,  such as 'printer on line',
## or 'power up'.  You can suppress reporting status for these codes
## by putting their code numbers in this list

pjl_quiet_codes=[
    10001
 ]

## Special error messages
##  One per line
##  The idea is that you may get an error code,  but you
## it is not 'standard'.  You can add additional codes here
## or override the default strings in the ifhp source.
## 
pjl_error_codes=[
    10006=Toner Low 
 ]

#--- END of PJL

#--- START of PostScript

## PostScript Information
##    WARNING - YOUR POSTSCRIPT PRINTER MAY NOT ACCEPT
##  SOME OF THE COMMANDS HERE.  Check the printer PostScript Printer
##  Description File for details.

## use the following string to cause the printer to echo
## ifhp will replace NAME by a unique identifier to make sure
## that the latest echo was detected

ps_status_code=
    %!PS-Adobe-2.0
## for PS Level 3 add:
#   false 0 startjob pop
    ( %%[ echo: NAME ]%% ) print () = flush

##  PageCount
##   This is a very nasty piece of PostScript that will
##  get the current pagecount value out of the statusdict
##  Note: you really should use the PS Level 3 if you have it
##  Note: some printers INSIST on ignoring the startjob stuff,
##    and will report the current pagecount.  You sometimes need
##    to sit in a loop and wait until it stops changing.
##    See pagecount_interval and pagecount_timeout

ps_pagecount_code=
    %!PS-Adobe-2.0
## for PS Level 3 add:
#   false 0 startjob pop
    /p{print}def ( %%[ pagecount: ) p
    statusdict begin pagecount end 20 string cvs p
    ( ]%% ) p () = flush

## PostScript options allowed by -T or -Z
##

ps_user_opts=[ manual inupper inlower outupper outlower envelope mediaselect
    simplex duplex duplexshort font transparency
	letter legal ledger oversize a3 a4 a5
    ]

## support for font download
##  use:  -Tfont=name1,font=name2
##  This will get expanded to fontdownload 
##  and fontdownload will get the ${font} value set by font=
##  the ps_fontdir value will be prefixed,  and
##   ${ps_fontdir}/name1  and ${ps_fontdir}/name2 will be downloaded
##  to the printer
##   
ps_fontdir=/usr/athena/lib/fonts/ps
ps_font=[ font_download ]


## Support for PostScript based page settings 
## YOU NEED TO CHECK YOUR PPD FILE FOR THIS STUFF
##
ps_duplex=   statusdict begin true setduplexmode false settumble end
ps_lduplex=  statusdict begin true setduplexmode false settumble end
ps_sduplex=  statusdict begin true setduplexmode true settumble end
ps_simplex=  statusdict begin false setduplexmode end
ps_inupper=  statusdict begin 0 setpapertray end
ps_inlower=  statusdict begin 1 setpapertray end
ps_manual=   statusdict begin /manualfeed true store end
ps_envelope= statusdict begin com10envelopetray end
ps_outupper= statusdict begin 0 setoutputtray end
ps_outlower= statusdict begin 1 setoutputtray end
ps_transparency= <</MediaType (Transparency)>> setpagedevice

mediaselect=3
ps_mediaselect=<</DeferredMediaSelection true /MediaPosition \%{mediaselect}>> setpagedevice


#--- END PostScript

#--- START PCL


##   Initialization

pcl_user_opts=[
    bold clearmargins courier crlf delete_fonts duplex duplexback
    duplexfront duplexselect duplexshort fixed font font_id
    font_op font_primary height helvetica hmi init
    init inlower inupper italic jobseparation landscape leftmargin
    leftoffset lineprinter linesperpage linewrap lpi manual normalpage
    orientation outlower outupper pc8 pagesize pitch portrait proportional
    rightmargin simplex source style symbol_set topmargin topoffset
    typeface user_opts vmi weight
    pagesize letter legal ledger a3 a4 a5
 ]

## turn LF into CRLF
pcl_crlf=\033&k2G
## turn line wrap on
pcl_linewrap=\033&s0C

## page (job) size
##  use -Zpagesize=n
## 1 - executive, 2 - letter, 3 - legal, 6 - ledger, 25 - A5, 26 - A4, 27 - A3
## 80 - Monarch Envelope, 81 - Comm. 10 Envelope, 90 - Intl. DL Envelope
## 91 - Intl. C5 Envelope, 100 - Intl. D5 Envelope, 101 - Custom
## 71 - Hagaki Postcard, 72 - Oufuku-Hagaki Postcard
pagesize=2
pcl_pagesize=\033&l\%{pagesize}A
pcl_letter=\033&l2A
pcl_legal=\033&l3A
pcl_ledger=\033&l6A
pcl_a5=\033&l25A
pcl_a4=\033&l26A
pcl_a3=\033&l27A

## paper source selection
##   use -Zsource=n
## 0 - current, 1 - upper, 2 - manual paper, 3 - manual envelope
## 4 - lower,   5 - optional paper  - 6 - optional manual
source=0
pcl_source=\033&l\%{source}H
pcl_inupper=\033&l1H
pcl_manual=\033&l2H
pcl_inlower=\033&l4H

## orientation
##  0 - portrait, 1, landscape, 2 - reverse portrait, 3 reverse landscape
pcl_orientation=\033&l\%{orientation}O
pcl_portrait=\033&l0O
pcl_landscape=\033&l1O

## simplex or duplex
##  0 - simplex,  1 - duplex long edge, 2 - duplex short edge
pcl_simplex=\033&l0S
pcl_duplex=\033&l1S
pcl_duplexshort=\033&l2S

## offsets
##  these are specified in 1/720 inch units
##  i.e. - if you want 1/2 inch, you need  720 x .5 = 360 units
leftoffset=0
pcl_leftoffset=\033&l\%{leftoffset}U
topoffset=0
pcl_topoffset=\033&l\%{topoffset}Z

## duplex page side selection
duplex_select=1
pcl_duplexselect=\033&a\%{duplexselect}G
pcl_duplexfront=\033&a1G
pcl_duplexback=\033&a2G

## job separaton
pcl_jobseparation=\033&l1T

## output bin 
## 0 - auto, 1 - bin 1,top/facedown 2 - bin 2,left/faceup
## 3 - bin 3 (HCO faceup)
## 4 - bin 4 (HCO 1, facedown)
## 5 - bin 5 (HCO 2, facedown)
## 6 - bin 6 (HCO 3, facedown)
## 7 - bin 7 (HCO 4, facedown)
## 8 - bin 8 (HCO 5, facedown)
## 9 - bin 9 (HCO 6, facedown)
## 10 - bin 10 (HCO 7, facedown)
## 11 - bin 11 (HCO 8, facedown)

outbin=1
pcl_outbin=\033&l\%{outbin}G
pcl_outupper=\033&l1G
pcl_outlower=\033&l2G

## margins
pcl_clearmargins=\0339
leftmargin=0
pcl_leftmargin=\033&a\%{leftmargin}L
rightmargin=80
pcl_rightmargin=\033&a\%{rightmargin}M
topmargin=0
pcl_topmargin=\033&l\%{topmargin}E
linesperpage=66
pcl_linesperpage=\033&l\%{linesperpage}F

## the HMI (Horizontal Motion Index)
##  this is dangerous...
##  This is the number of 1/120 inch unit per character
##  i.e. - 120 unit per inch
##  If you want 10 cpi, you want HMI = 120/10 = 12
hmi=12
pcl_hmi=\033&k\%{hmi}H

## the VMI (Vertical Motion Index)
##  this is dangerous...
##  This is the number of 1/48 inch unit per line
##  i.e. - 48 unit per inch
##  If you want 6 lines per inch, you want HMI = 48/6 = 8
vmi=8
pcl_vmi=\033&l\%{vmi}C

## the LPI (Lines Per Inch) - inverse of VMI
##  This is the lines per line
##  If you want 6 lines per inch, you want LPI = 6
lpi=6
pcl_lpi=\033&l\%{lpi}D

## symbol set
##  - don't fool around with this one...
## 10U = PC 8 - shows the funny PC characters???
##
symbol_set=8U
pcl_symbol_set=\033(\%{symbol_set}
pcl_pc8=\033(10U

## spacing
##  0 - fixed, 1 - proportional
pcl_fixed=\033(s0P
pcl_proportional=\033(s1P

## pitch for fixed spaced font
##  in characters per inch
pitch=10
pcl_pitch=\033(s\%3.2f{pitch}H

## height for proportional spaced font
##  in points
height=10
pcl_height=\033(s\%3.2f{height}H

## style for proportional spaced font
##  0 - normal, 1 - italic, 4 condensed, etc
style=0
pcl_style=\033(s\%{style}S
pcl_italic=\033(s1S


## weight -
##  ranging from -7 (ultra thin) to 7 (ultra black)
weight=0
pcl_weight=\033(s\%{weight}B
pcl_bold=\033(s3B

## Typeface Family
## See Appendic C in the PCL 5 comparison guide
##   consists of foundary * 4096 + fontid
##   foundary = 1 - AGFA, 2- Bitstream, etc 
##   fontid   = 0 - line printer, 3 = courier, 4 = helvetica
##   id 4099 - Courier
##      4100 - Helvetica
##
typeface=4099
pcl_typeface=\033(s\%{typeface}T
pcl_courier=\033(s4099T
pcl_helvetica=\033(s4100T
pcl_lineprinter=\033(s0T


##
## Fonts and Font Downloading
##  fontid is used to set the current font
font_id=1
pcl_font_id=\033*c\%{font_id}D
## set primary font
font_primary=1
pcl_font_primary=\033(\%{font_primary}X

## font control
##
font_op=0
pcl_font_op=\033*c\%{font_op}F
pcl_delete_fonts=\033*c0F

## font directory
font=c1201b.10
pcl_fontdir=/usr/athena/lib/fonts/pcl

## combination command
pcl_font=[ delete_fonts font_id font_download font_primary ]

## canned setup
pcl_normalpage=[ letter crlf linewrap portrait clearmargins fixed pitch=10 courier ]

pcl_init=[ normalpage ]

##
## text conversion control
##
## control text to whatever conversion
##
## if you cannot find type, then try this file utility
##
## if the type is text and not supported on your system, do a conversion
##
##  Method 1 - set 'default_language' as text, and run
##    the program through a text to known converter
## the a2ps utility is available from:
##   A2PS - Ascii Text to PostScript Converter
##      http://www-inf.enst.fr/~demaille/a2ps
##      ftp://ftp.enst.fr/pub/unix/a2ps/
##
##  You can also use nscript:
##      ftp.gnu.org:gnu/nscript/
##
## The a2ps options -q -B -1 -M Letter --borders=no -o-
##  will do: -q   = quiet, no message
##           -1   = 1 virtual (page?)
##           -B   = no header
##           -M Letter = use letter size paper
##           --borders=no  = no borders
##           -o-  = output to STDOUT
##  Similar options seem to work for enscript as well.

##   NOTE:  the option values ZOPTS  and TOPTS will get replaced with
##   -Zzoptions and -Ttoptions respectively,  allowing you to do the
##   necessary PostScript fixes based on options as well

##
##  
##  Method 2 - 
##    Use the file util and match the output
##  if default_language = unkown then  invoke 'file' and then
##  use the pattern match of the output.
##  The file_output_match[] entries are 1 per line with the format:
##   glob  output_format  /pathtoconverter option option option
##  Spaces in the output can be matched with %20 (URL escaped space)
## Example:
## file_output_match = [
## *text*  ps /usr/local/bin/a2ps -q -B -1 -M Letter --borders=no -o-
##                   300dpi@8inches = 2400 pixels
##                   300dpi@11inches = 3300 pixels
## *%20gif%20*  pcl /usr/local/bin/gif2pcl --autosize -x 2400 -y 3300 -d=300 -o-
## ]

##   NOTE:  the option values ZOPTS  and TOPTS will get replaced with
##   -Zzoptions and -Ttoptions respectively,  allowing you to do the
##   necessary PostScript fixes based on options as well
##   For example,  if the filter was /usr/local/bin/mystuff ZOPTS
##   and you did lpr -Zlandscape,  then you would get
##     /usr/local/bin/mystuff -Zlandscape.  This would allow you to
##   process the text file appropriately

## 
##  file - utility to determine file type
##     ftp://ftp.astron.com/pub/file/
##     ftp.deshaw.com/pub/file/
##     Also available from the RedHat.com SRPMS in (of course) rpm format
##
## file reports format information
##   
##  glob text_output_format text_converter
##
## For method 1,  set default_language=text
# default_language=text
## For method 1,  set default_language=unknown
default_language=unknown

##  Method 1 text converter program
# text_converter=/usr/athena/libexec/filters/textps
## output of the converter is pcl, ps, or raw
# text_converter_output=ps

##  Method 2 file utility path
file_util_path=/usr/athena/libexec/filters/check_unprintable
##  Method 2 patterns and outputs
file_output_match = [
 *text*  ps /usr/athena/libexec/filters/textps
 *       ps /usr/athena/libexec/filters/reject_unprintable -
]
## you may need a temp file location
##
##  This will be extended to ..ifhpXXXXX
##   for use by the unix mktemp() routine
##
tempfile=/var/tmp/ifhp

## Printer Specific Configurations

## Apple or PostScript Printers
[ apple postscript ps ]
pjl@
pcl@
ps
text@

## HP Printers
## These all support PJL to a limited extent and PCL as well
### 
[ hp hpiiisi ]
pjl_only=[
    COMMENT ENTER
 ]

[ hp4 hp4m hp4si hp4simx hp4plus hp4mplus hp4v hp4mv hp4p hp4mp hp4pj hpljpro hp4lc ]
pjl_except=[
    FSAPPEND FSDIRLIST FSQUERY FSUPLOAD FSDELETE FSDOWNLOAD FSINIT FSMKDIR
 ]

[ hp4v hp4mv ]
# Paper Selection By Size
ps_letter= <</DeferredMediaSelection true /PageSize [612 792] /ImagingBBox null>> setpagedevice
ps_legal= <</DeferredMediaSelection true /PageSize [612 1008] /ImagingBBox null>> setpagedevice
ps_ledger=<</DeferredMediaSelection true /PageSize [792 1224] /ImagingBBox null>> setpagedevice
ps_oversize=<</DeferredMediaSelection true /PageSize [842 1274] /ImagingBBox null>> setpagedevice
ps_a3 = <</DeferredMediaSelection true /PageSize [842 1191] /ImagingBBox null>> setpagedevice
ps_a4 = <</DeferredMediaSelection true /PageSize [595 842] /ImagingBBox null>> setpagedevice


[ hp4l hp5l hp6l ]
pjl_except=[
    EOJ JOB OPMSG RDYMSG STMSG
    FSAPPEND FSDIRLIST FSQUERY FSUPLOAD FSDELETE FSDOWNLOAD FSINIT FSMKDIR
 ]

[ hp4ml hp5p hp5mp hp6p hp6mp ]
pjl_except=[
    OPMSG RDYMSG STMSG
    FSAPPEND FSDIRLIST FSQUERY FSUPLOAD FSDELETE FSDOWNLOAD FSINIT FSMKDIR
 ]

######### HP 5 SI MX
#########  These may NOT work on other printers
[ hp5si hp5simx hp5 hp5m ]
pjl_except=[
    FSAPPEND FSDIRLIST FSQUERY FSUPLOAD
 ]
ps_manual=<</ManualFeed true>> setpagedevice
ps_envelope=<</DeferredMediaSelection true /MediaPosition 2>> setpagedevice


## HP 5SiMX
ps_inupper=[ tray1 ]
ps_inlower=[ tray2 ]


## *InputSlot Tray1/Tray 1:
ps_tray1=<</DeferredMediaSelection true /MediaPosition 3>> setpagedevice

##InputSlot Tray2/Tray 2: 
ps_tray2=<</DeferredMediaSelection true /MediaPosition 0>> setpagedevice

##InputSlot Tray3/Tray 3: 
ps_tray3=<</DeferredMediaSelection true /MediaPosition 1>> setpagedevice

##InputSlot Tray4/Tray 4: 
ps_tray4=<</DeferredMediaSelection true /MediaPosition 4>> setpagedevice

## *OutputBin Upper/Top Output Bin (Face Down):
##ps_outupper=<</Staple 0 /OutputType (TOP OUTPUT BIN)>> setpagedevice
## *OutputBin Left/Left Output Bin (Face Up):
##ps_outlower=
##   currentpagedevice /OutputAttributes get
##   5 known
##         {<</Staple 0 /OutputType (FACE UP BIN)>> setpagedevice}
##         {<</Staple 0 /OutputType (LEFT OUTPUT BIN)>> setpagedevice}
##       ifelse
##
## *OutputBin Stacker/Stacker (Face Down):
ps_outbin2=<</Staple 0 /OutputType (OPTIONAL OUTBIN 2)>> setpagedevice

## *OutputBin Separator/Job Separator (Face Down): 
ps_outbin3=<</Staple 0 /OutputType (OPTIONAL OUTBIN 2)>> setpagedevice

## *OutputBin Stapler/Stapler (Face Down):         
ps_outbin4=<</Staple 2>> setpagedevice

## *OutputBin OutputBin1/Mailbox 1 (Face Down):    
ps_outbin5=<</Staple 0 /OutputType (OPTIONAL OUTBIN 2)>> setpagedevice

## *OutputBin OutputBin2/Mailbox 2 (Face Down):    
ps_outbin6=<</Staple 0 /OutputType (OPTIONAL OUTBIN 3)>> setpagedevice

## *OutputBin OutputBin3/Mailbox 3 (Face Down):    
ps_outbin7=<</Staple 0 /OutputType (OPTIONAL OUTBIN 4)>> setpagedevice

## *OutputBin OutputBin4/Mailbox 4 (Face Down):    
ps_outbin8=<</Staple 0 /OutputType (OPTIONAL OUTBIN 5)>> setpagedevice

## *OutputBin OutputBin5/Mailbox 5 (Face Down):    
ps_outbin9=<</Staple 0 /OutputType (OPTIONAL OUTBIN 6)>> setpagedevice

## *Duplex None/Off: 
ps_simplex=
     <</Duplex false /Tumble false>> setpagedevice
## *Duplex DuplexNoTumble/Long-Edge Binding: 
ps_duplex=
     <</Duplex true /Tumble false>> setpagedevice
## *Duplex DuplexTumble/Short-Edge Binding: 
ps_duplexshort=
     <</Duplex true /Tumble true>> setpagedevice

[ hp5simopier hp4000 hp4500c hp5000 hp8000 ]
pjl_except= [
 ]

[ hpcolorlj hpcolorlj5 hpcolorlj5m ]
pjl_only=[
    COMMENT ECHO ENTER EOJ
    INFO INITIALIZE INQUIRE JOB PJL RDYMSG
    USTATUS USTATUSOFF
 ]

[ hpdj1200c hppjxl300 ]
pjl_only=[
    COMMENT ENTER
    PJL
 ]
status@

[ hpdj1600c ]
pjl_only=[
    COMMENT DEFAULT DINQUIRE ECHO ENTER EOJ
    JOB PJL
    RESET SET
]
[ hpdj200 hpdj220 hpdj350c hpdj600 hpdj650c ]
pjl_only=[
    COMMENT ECHO ENTER
    INFO 
    USTATUS USTATUSOFF
 ]
[ hpdj230 hpdj250c hpdj330 hpdj350c hpdj430 hpdj450c hpdj455ca hpdj700 hpdj750c hpdj750cplus hpdj755cm hpdj2000cp hpdj2500cp ]
pjl_only=[
    COMMENT ECHO ENTER EOJ
    INFO JOB RESET SET
    USTATUS USTATUSOFF
 ]

##
##  QMS Printers do not seem to return status or other information
##  you may need to configure them to connect on port 35
## printcap 
##  lp:ifhp=model=qms1725,dev=qms.printer.ip.addr%35
##    :lp=/dev/null
##    :if=..../ifhp
##
[ qms1725 ]
appsocket
status@
pjl@
pcl@
ps
text@
#*DefaultDuplex: None
#*Duplex None: statusdict begin false setduplexmode false settumble end
ps_simplex=statusdict begin false setduplexmode false settumble end
#*Duplex DuplexNoTumble: statusdict begin true setduplexmode false settumble end
ps_duplex=statusdict begin true setduplexmode false settumble end
#*Duplex DuplexTumble: statusdict begin true setduplexmode true settumble end
ps_lduplex=statusdict begin true setduplexmode true settumble end

#*InputSlot Upper: statusdict begin 1 setpapertray end
ps_inupper=statusdict begin 1 setpapertray end
#*InputSlot Lower: statusdict begin 2 setpapertray end
ps_inlower=statusdict begin 2 setpapertray end
#*InputSlot Envelope: statusdict begin 3 setpapertray end
ps_envelope=statusdict begin 3 setpapertray end

ps_manual=   1 dict dup /ManualFeed true put setpagedevice

#*OutputBin Upper: statusdict begin 1 setoutputray end
#*OutputBin Back: statusdict begin 2 setoutputtray end

ps_outupper= statusdict begin 1 setoutputray end
ps_outlower= statusdict begin 2 setoutputtray end

# QMS 2025 appears to be HP compatible
# QMS 860 has same tray as QMS2025
[ qms2025 qms860 ]
appsocket
status@
pjl@
pcl
ps
text@
#*PageSize Letter: statusdict begin lettertray end
ps_letter=statusdict begin lettertray end
#*PageSize Legal: statusdict begin legaltray end
ps_legal=statusdict begin legaltray end
#*PageSize Tabloid: statusdict begin 11x17tray end
ps_ledger=statusdict begin 11x17tray end
#*PageSize Executive: statusdict begin executivetray end
ps_executive=statusdict begin executivetray end
#*PageSize A3: statusdict begin a3tray end
ps_a3=statusdict begin a3tray end
#*PageSize A4: statusdict begin a4tray end
ps_a4=statusdict begin a4tray end
#*PageSize A5: statusdict begin a5tray end
ps_a5=statusdict begin a5tray end
#*PageSize B4: statusdict begin b4tray end
ps_b4=statusdict begin b4tray end
#*PageSize B5: statusdict begin b5tray end
ps_b5=statusdict begin b5tray end
#*PageSize B6: statusdict begin b6tray end
ps_b6=statusdict begin b6tray end


## Tektronix Color Printers
##  uses 'appsocket' protcol
##   TCP port 9100
##    receives job status
##   UPD port 9101
##    receives status
##    send a '\r\n' or 0 length packet to UDP port
##    responds with status information
##
## printcap entry:
##  lp:cm=Phaser
##    :lp=/dev/null
##    :ifhp=model=tek,dev=10.0.0.1%9100
##    :if=/usr/local/bin/ifhp
##
##  OR
##
##  lp:cm=Phaser
##    :lp=/dev/null
##    :if=/usr/local/bin/ifhp -Tmodel=tek,dev=10.0.0.1%9100
##
##  If you insist on banner pages or need powerful accounting
##  and need an OF filter (NOT recommended with the appsocket protocol),
##  then add (respectively to the above examples):
##
##    :of=/usr/local/bin/ifhp
##  OR
##    :of=/usr/local/bin/ifhp -Tmodel=tek,dev=10.0.0.1%9100
##  

[ tek* phaser* ]
appsocket
pjl@
pcl@
ps
sync@
ps_pagecount_code=%!
 false 0 startjob pop
 (%%[ pagecount: )print statusdict /pagecount get exec (                )cvs
  print
 ( ]%% )= flush
ps_inupper=
 product (Phaser 2) anchorsearch
 { pop pop 2 dict begin
 	/InputAttributes 1 dict begin /Priority [0] def currentdict
 end def }
 {  (Phaser 440) anchorsearch
 	{ pop pop 3 dict begin
 		/MediaType (Upper Tray) def
 		/MediaColor null def }
 	{ pop 4 dict begin
 		/MediaPosition 0 def
 		/MediaType null def
 		/ManualFeed false def } ifelse
 } ifelse
 /TraySwitch false def
 currentdict end setpagedevice
