From jeffs@lsil.com Sat Jan 14 23:24:42 EST 1995
Article: 47054 of comp.sys.sun.admin
Path: babbage.ece.uc.edu!news.cs.indiana.edu!usenet.ucs.indiana.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!swrinde!ihnp4.ucsd.edu!news.cerf.net!lsi.lsil.com!up133!jeffs
From: jeffs@lsil.com (Jeff Spiegel)
Newsgroups: comp.sys.sun.admin
Subject: Lots of Printcaps (HP LaserJet II)
Date: 13 Jan 1995 17:29:35 GMT
Organization: LSI Logic Corporation
Lines: 3315
Message-ID: <3f6d9v$bpo@lsi.lsil.com>
NNTP-Posting-Host: 147.145.12.133
X-Newsreader: Tin 1.1 PL5
INFODOC ID: 2089
SYNOPSIS: List of printcap entries
DETAIL DESCRIPTION:
Note: This collection of printcap entries is offered as a courtesy,
and is in no way to be considered official or in any way sponsored by
Sun Microsystems. This file may contain errors and is used at user's
risk.
Please adviseSun of results of use or tests of printcap entries
so that specific entries can be recorded as verified.
Printcap entries that are not in this list should be requested from
or sent to rik@Corp.Sun.COM.
TABLE OF CONTENTS:
New items are marked with an ASTERISK.
==========================[THE PRINTCAPS]=================================
1) APPLE LASERWRITER - 386i
2) BENSON 1300 PLOTTER -LOCAL
3) BENSON 1300 PLOTTER -REMOTE
4) BENSON 1600 PLOTTER -LOCAL
5) BENSON 1600 PLOTTER -REMOTE
6) BENSON 36 INCH DOT MATRIX -LOCAL
7) BENSON 36 INCH DOT MATRIX -REMOTE
8) CALCOMP (OFF-LINE CALCOMP PLOTTER) -LOCAL
9) CALCOMP (OFF-LINE CALCOMP PLOTTER) -REMOTE
10) CALCOMP 1023 PLOTTER (VAR)
11) CALCOMP 1023 PLOTTER SS1 (All purpose)
12) CALCOMP 1023 PLOTTER
13) CALCOMP 1043 PLOTTER
14) CALCOMP 1043 PLOTTER -LOCAL
15) CALCOMP 1043 PLOTTER -REMOTE
16) CALCOMP 1044 PLOTTER -LOCAL
17) CALCOMP 1044 PLOTTER -REMOTE
18) CALCOMP 5744 PLOTTER
19) CALCOMP 5744 PLOTTER -REMOTE
20) CALCOMP 907 PLOTTER -LOCAL
21) CALCOMP 907 PLOTTER -REMOTE
22) CALCOMP 960 PLOTTER -LOCAL
23) CALCOMP 960 PLOTTER -REMOTE
24) CALCOMP 965 PLOTTER -LOCAL
25) CALCOMP 965 PLOTTER -REMOTE
26) CALCOMP DRAWINGMASTER
27) CANON LASERPRINTER
28) DATAPRODUCTS 8070 PLUS LINE PRINTER
29) DATAPRODUCTS 8070 PLUS-2
30) DATAPRODUCTS 8070 PLUS-3
31) DATAPRODUCTS LASER PRINTER -LOCAL
32) DATAPRODUCTS LASER PRINTER -REMOTE
33) *DEC Digital 75-dot matrix
34) *DEC LA324
35) *DEC LN03
36) *DEC LN03 PostScript
37) EPSON EX1000 (over a tty line)
38) EPSON FOR STSC APL
39) EPSON FX-185 -LOCAL
40) EPSON FX-185 -REMOTE
41) EPSON IN PLOT MODE (raster graphics)
42) EPSON LQ2550 SERIAL
43) EPSON TEXT
44) EPSON VP-130K PRINTER
45) EPSON VP-130K PRINTER -LOCAL
46) ERICSSON 4156
47) ERICSSON 4160
48) ERICSSON 4511 (4512) CENTRONICS
49) ERICSSON 4511 (4512) RS232
50) ERICSSON 5819 CENTRONICS
51) FACIT LASER P7080 IN DIABLO 630/CENTRONICS
52) FACIT LASER P7080 IN DIABLO 630/RS232
53) FUJITSU GRAPHICS HARDCOPY DEVICE
54) GE TERMINET 340 LINE PRINTER -REMOTE
55) GE TERMINET 2120 LINE PRINTER -LOCAL
56) GE TERMINET 2120 LINE PRINTER -REMOTE
57) GE TERMINET 340 LINE PRINTER -LOCAL
58) GERBER (OFF-LINE GERBER PLOTTER) -LOCAL
59) GERBER (OFF-LINE GERBER PLOTTER) -REMOTE
60) HP 2932 LINE PRINTER
61) HP 7475 PLOTTER (LONG FILE)
62) HP 7475A PLOTTER
63) HP 7550A PEN PLOTTER
64) HP 7580 (A SUGGESTION! LONG FILE)
65) HP 7580 PLOTTER
66) HP 7580 PLOTTER -LOCAL
67) HP 7580 PLOTTER -REMOTE
68) HP 7595
69) HP 7595 DRAFTMASTER
70) HP 7750A
71) HP GENERIC
72) *HP III
73) HP LASERJET
74) HP LASERJET (LONG FILE)
75) HP LASERJET IIP, IID (PC-NFS OK)
76) HP LASERJET PLUS!! (THIS IS A VERY LONG ONE!!)
77) HP LASERJET PRINTERS & 386i (LONG FILE)
78) *HP Laserjet II/III
79) *HP Laserjet si - Filters
80) HP PAINTJET XL
81) HP THINKJET
82) *HPLJII
83) IBM PROPRINTER
84) IMAGEN LASER PRINTER -LOCAL
85) IMAGEN LASER PRINTER -REMOTE
86) LASERWRITER PLUS (GENERIC)
87) LASERWRITER PLUS
88) LW II IN DIABLO MODE
89) MONOTYPE LASERCOMP TYPESETTER
90) NEC LC 890
91) NEC LC890 (it works!)
92) *NEC SILENTWRITER (VERY LONG LISTING)
93) *OKIDATA MICROLINE 391 - RS232 SERIAL PORT (/dev/ttya)
94) P1000 PLOTTER -LOCAL
95) P1000 PLOTTER -REMOTE
96) *PACIFIC DATA PRODUCTS PRO TRACER
97) PLOTTERS AND SPARCSTATION 1's
98) PRINT-A-COLOR COLOR PRINTERS
99) PRINTRONIX P600 PARALLEL PRINTER
100) PRINTRONIX TEXT ONLY
101) PRINTRONIX W/TAB SUPPORT
102) PRINTRONIX WITH ELECTRONIC VERTICAL FORMS CONTROL
103) *QMS 810 (VERY LONG LISTING)
104) *QMS ESP Printers - SunOS 4.1 or greater
105) SEIKO COLOR THERMAL TRANSFER PLOTTER -LOCAL
106) SEIKO COLOR THERMAL TRANSFER PLOTTER -REMOTE
107) TEKTRONIX PLOTTER
108) TI 810
109) TI LASER PRINTER -LOCAL
110) TOSHIBA LBP1080 LASER PRINTER -LOCAL
111) TOSHIBA LBP1080 LASER PRINTER -REMOTE
112) TOSHIBA PT5500B PRINTER -LOCAL
113) TOSHIBA PT5500B PRINTER -REMOTE
114) TRANSCRIPT PRINTER DRIVER
115) VERSATEC 36 INCH -LOCAL
116) VERSATEC 36 INCH -REMOTE
117) VERSATEC 8242
118) VERSATEC 8836
119) VERSATEC COLOR THERMAL TRANSFER PLOTTER -REMOTE
120) VERSATEC COLOR THRMAL TRANSFER PLOTTER
121) VERSATEC HARDCOPY DOT-MATRIX PLOTTER -LOCAL
122) VERSATEC HARDCOPY DOT-MATRIX PLOTTER -REMOTE
================================[TUTORIALS]================================
1) GENERIC PRINTCAP TUTORIAL
2) CALCOMP 1023 PLOTTER TUTORIAL (long)
3) SETTINGS FOR OPERATING OKIDATA MICROLINE 391 VIA RS232 SERIAL PORT
==========================[THE PRINTCAPS]=================================
1) APPLE LASERWRITER - 386i ---------------------------------------------
#Apple laserwriter on a 386i
lp | lw: :lp=/dev/ttya: :br#9600:rw:fc#0000374:fs#0000003: :xc#0:xs#0040040:mx#0: :sd=/var/spool/lpd: :lf=/var/adm/lpd-errs: :sh: :sf: :sb
2) BENSON 1300 PLOTTER -LOCAL ----------------------------------------
# Local Benson 1300 plotter
#
BNS@|PPLT|benson13|Benson 1300 plotter: :lp=/dev/tty@:sd=/usr/spool/benson13d: :lf=/usr/spool/benson13d/log: :vf=/usr/lib/benson13f:sh:sf:br#9600: :gf=/usr/lib/benson13f:
3) BENSON 1300 PLOTTER -REMOTE ---------------------------------------
# Remote Benson 1300 plotter
#
BNS@|PPLT|Benson 1300 plotter: :lp=:rm=BNS@host:rp=BNS@:sd=/usr/spool/benson13d: :lf=/usr/spool/benson13d/log:
4) BENSON 1600 PLOTTER -LOCAL ----------------------------------------
# Local Benson 1600 plotter
#
BNS@|PPLT|benson16|Benson 1600 plotter: :lp=/dev/tty@:sd=/usr/spool/benson16d: :lf=/usr/spool/benson16d/log: :vf=/usr/lib/benson16f:sh:sf:br#9600: :gf=/usr/lib/benson16f:
5) BENSON 1600 PLOTTER -REMOTE ----------------------------------------
# Remote Benson 1600 plotter
#
BNS@|PPLT|Benson 1600 plotter: :lp=:rm=BNS@host:rp=BNS@:sd=/usr/spool/benson16d: :lf=/usr/spool/benson16d/log:
6) BENSON 36 INCH DOT MATRIX -LOCAL -----------------------------------
#
# Local 36 inch BensonDot Matrix
# NOTE:
# py#1524 indicates a band width of 6 inches,
# at a raster density of 254 dots per inch
#
# px#8960 indicates a raster density of 254 dots per inch,
# plot width 35.2 inches
#
VR6@|DTMX|Benson 36 inch plotter: :lp=/dev/vp0:sd=/usr/spool/vpd:sb:sf:mx#0:pw#106:pl#86: :px#8960: :py#1524: :rd#254: :of=/usr/lib/vpfW:if=/usr/lib/vpsf:tf=/usr/lib/vcat:cf=/usr/lib/vdmp: :gf=/usr/lib/versatecf:vf=/usr/lib/vpltdmp:lf=/usr/spool/vpd/log:
7) BENSON 36 INCH DOT MATRIX -REMOTE -----------------------------------
# Remote 36 inch Benson Dot Matrix
#
VR6@|DTMX|Benson 36 inch plotter: :lp=:rm=VR6@host:rp=VR6@:sd=/usr/spool/vpd: :lf=/usr/spool/vpd/log:
8) CALCOMP (OFF-LINE CALCOMP PLOTTER) -LOCAL ----------------------------
# Local Off-line Calcomp plotter (Put Calcomp)
#
CAL@|SCGM|CALCOMP|Calcomp offline plotter :sd=/usr/spool/calcomp925d: :lf=/usr/spool/calcomp925d/log: :zf=/cadds/lib/calcomp925f:sf:sh: :lp=/dev/null:
9) CALCOMP (OFF-LINE CALCOMP PLOTTER) -REMOTE ---------------------------
# Remote Off-line Calcomp plotter (Put Calcomp)
#
CAL@|SCGM|CALCOMP|Calcomp offline plotter :sd=/usr/spool/calcomp925d: :lf=/usr/spool/calcomp925d/log: :lp=:rm=CAL@host:rp=CAL@:
10) CALCOMP 1023 PLOTTER (VAR) -------------------------------------------
lp: :lp=/dev/ttya:sd=/var/spool/lp:br#9600:sf:sh:mx#0:\
:ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
Use these settings on the 1023:
Plotter type= 7585A
format= CPGL
baud rate= 9600
8 data bits, 1 stop bit
no parity
Note that this information is for the 386i running 4.0.2.
For SS1's (which dont have as many flow control problems) we give out
this all-purpose printcap:
lp: :lp=/dev/ttya:sd=/var/spool/lp:br#9600:sb:sh:sf: :fs#06021:fc#0777:xc#07737:xs#040:
11) CALCOMP 1023 PLOTTER SS1 (All purpose) -------------------------------
#
#For SS1's (which dont have as many flow control problems) we give out
#this all-purpose printcap:
#
lp: :lp=/dev/ttya:sd=/var/spool/lp:br#9600:sb:sh:sf: :fs#06021:fc#0777:xc#07737:xs#040:
12) CALCOMP 1023 PLOTTER -------------------------------------------------
lp: :lp=/dev/ttya:sd=/var/spool/lp:br#9600:sf:sh:mx#0: :ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
Use these settings on the 1023:
Plotter type= 7585A
format= CPGL
baud rate= 9600
8 data bits, 1 stop bit
no parity
13) CALCOMP 1043 PLOTTER -------------------------------------------------
I did some testing with a Calcomp 1044 plotter(which is the roll-feed
version of the 1043) yesterday and was able to get a set of working
settings for the 386i. I was able to get a 1Mb plot file to go out to the
plotter no problem.
The plotter settings that I used were the following:
PCI mode
7 data bits
1 stop bit
even parity
xon/xoff= yes
direct control =yes or no
full duplex
sync code = 2
sync code value = 022
internal clock
term muting = no
chksum enable = yes
isochronous = no
The switch bank on the back of the plotter had switch 5 on and all the
rest off. This meant it was set to normal DTE.
The printcap entry used for the plotter was the following:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0:\
:ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
14) CALCOMP 1043 PLOTTER -LOCAL ------------------------------------------
# Local Calcomp 1043 Plotter
#
C96@|PPLT|c1043|Calcomp 1043 Plotter: :lp=/dev/tty@:sd=/usr/spool/c1043d: :lf=/usr/spool/c1043d/log: :vf=/usr/lib/c1043f:sh:sf:br#9600: :gf=/usr/lib/c1043f:
15) CALCOMP 1043 PLOTTER -REMOTE ----------------------------------------
# Remote Calcomp 1043 Plotter
#
C96@|PPLT|Calcomp 1043 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c1043d: :lf=/usr/spool/c1043d/log:
16) CALCOMP 1044 PLOTTER -LOCAL -----------------------------------------
# Local Calcomp 1044 Plotter
#
C96@|PPLT|c1044|Calcomp 1044 Plotter: :lp=/dev/tty@:sd=/usr/spool/c1044d: :lf=/usr/spool/c1044d/log: :vf=/usr/lib/c1044f:sh:sf:br#9600: :gf=/usr/lib/c1044f:
17) CALCOMP 1044 PLOTTER -REMOTE ---------------------------------------
#
#Remote Calcomp 1044 Plotter
#
C96@|PPLT|Calcomp 1044 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c1044d: :lf=/usr/spool/c1044d/log:
18) CALCOMP 5744 PLOTTER -----------------------------------------------
# LocalCalcomp 5744 Plotter
#
C96@|PPLT|c5744|Calcomp 5744 Plotter: :lp=/dev/tty@:sd=/usr/spool/c5744d: :lf=/usr/spool/c5744d/log: :vf=/usr/lib/c960f:sh:sf:br#9600: :mo=5744: :gf=/usr/lib/c960f:
19) CALCOMP 5744 PLOTTER -REMOTE -----------------------------------------
# Remote Calcomp 5744 Plotter
#
C96@|PPLT|Calcomp 5744 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c5744d: :lf=/usr/spool/c5744d/log:
20) CALCOMP 907 PLOTTER -LOCAL ------------------------------------------
# Local Calcomp 907 Plotter
#
C96@|PPLT|c907|Calcomp 907 Plotter: :lp=/dev/tty@:sd=/usr/spool/c907d: :lf=/usr/spool/c907d/log: :vf=/usr/lib/c907f:sh:sf:br#9600: :gf=/usr/lib/c907f:
21) CALCOMP 907 PLOTTER -REMOTE ----------------------------------------
# Remote Calcomp 907 Plotter
#
C96@|PPLT|Calcomp 907 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c907d::lf=/usr/spool/c907d/log:
22) CALCOMP 960 PLOTTER -LOCAL ----------------------------------------
# Local Calcomp 960 Plotter
#
C96@|PPLT|c960|Calcomp 960 Plotter: :lp=/dev/tty@:sd=/usr/spool/c960d: :lf=/usr/spool/c960d/log: :vf=/usr/lib/c960f:sh:sf:br#9600: :gf=/usr/lib/c960f:
23) CALCOMP 960 PLOTTER -REMOTE ------------------------------------------
# Remote Calcomp 960 Plotter
#
C96@|PPLT|Calcomp 960 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c960d: :lf=/usr/spool/c960d/log:
24) CALCOMP 965 PLOTTER -LOCAL ------------------------------------------
# Local Calcomp 965 Plotter
#
C96@|PPLT|c965|Calcomp 965 Plotter: :lp=/dev/tty@:sd=/usr/spool/c965d: :lf=/usr/spool/c965d/log: :vf=/usr/lib/c965f:sh:sf:br#9600: :gf=/usr/lib/c965f:
25) CALCOMP 965 PLOTTER -REMOTE -----------------------------------------
# Remote Calcomp 965 Plotter
#
C96@|PPLT|Calcomp 965 Plotter: :lp=:rm=C96@host:rp=C96@:sd=/usr/spool/c965d: :lf=/usr/spool/c965d/log:
26) CALCOMP DRAWINGMASTER -----------------------------------------------
This is a working printcap entry for the Calcomp Drawingmaster connected
to a 4/60:
lp|cal|CAL|calcomp|Calcomp-Drawingmaster: :lp=/dev/ttyb:br#19200: :sd=/var/spool/lp:mx#0:sf:sh: :lf=/var/spool/lp/lp-errors: :ms=cs7,parenb,-parenodd,-opost,-echo,ixon,istrip:
The wiring is pin 2,3,7 straight through.
Calcomp settings:
com1
Input Monitor Dump = NO
Baudrate = 19200
Character Framing (bits,parity,stop bits) = 7,E,1
Host to Plotter CDLC Protocol = CTS
Plotter to Host CDLC Protocol = CTS
Dead Job Time Out (SEC) = 10
Time Out Action = FORCE
Plot Command Language = 907
Steps per Inch = 400
Plot Data Protocol = XON/XOFF
Beginning of Record Sync Character = S16
Number of Sync Characters = 2
End of Record Character = SOD
Checksum = Y
27) CANON LASERPRINTER --------------------------------------------------
# canon laser printer
2|lp3|pp3|laser printer: :sd=/usr/spool/lpd:lf=/usr2/util/.printer.log: :br#9600:fc#0177777:fs#0006020:lp=/dev/tty0a:xc#0177777:xs#040000:
28) DATAPRODUCTS 8070 PLUS LINE PRINTER --------------------------------
#Printer config for XON/XOFF, 9600 baud, serial
#
#Custom Cable:
# Sun Printer
# 2 ----- 3
# 3 ----- 2
# 7 ----- 7
# 5 ----- 25
#
#
# Dataproducts 8070
dp8070|zebu|dw8|impact: :lp=/dev/ttya: :rp=dp8070: :sd=/var/spool/dp8070::lf=/var/spool/dp8070/dp8070-log: :br#9600:rw: :pl#66:pw#132: :sh:ms=-oddp,ixon,ixany,crtscts:
29) DATAPRODUCTS 8070 PLUS-2 ---------------------------------------------
#Printer config for XON/XOFF, 9600 baud, serial
# Custom Cable:
# Sun Printer
# 2 ----- 3
# 3 ----- 2
# 7 ----- 7
# 5 ----- 25
#
# Dataproducts 8070
dp8070|zebu|dw8|impact: :lp=/dev/ttya: :rp=dp8070: :sd=/var/spool/dp8070: :lf=/var/spool/dp8070/dp8070-log: :br#9600:rw: :pl#66:pw#132: :sh:ms=-oddp,ixon,ixany,crtscts:
30) DATAPRODUCTS 8070 PLUS-3 ---------------------------------------------
#
# Dataproducts 8070 Plus
dp8070|impact: :lp=/dev/ttya: :rp=dp8070: :sd=/var/spool/dp8070: :lf=/var/spool/dp8070/dp8070-log: :br#9600:rw: :pl#66:pw#132: :sh:ms=-oddp,ixon,ixany,crtscts:
31) DATAPRODUCTS LASER PRINTER -LOCAL -------------------------------------
# Local DataProducts Laser Printer
#
dp@|DP|Data Products laser printer(local tech pubs): :lp=/dev/lp0:sd=/usr/spool/ipd2: :lf=/usr/spool/ipd2/log:if=/usr/spool/ipd2/imppop:sh:sb:sf:rw:
32) DATAPRODUCTS LASER PRINTER -REMOTE -----------------------------------
# Remote DataProducts Laser Printer
#
dp@|DP|Data Products laser printer(remote tech pubs): :lp=:rm=dp@host:rp=dp@:sd=/usr/spool/ipd2: :lf=/usr/spool/ipd2/log:sh:sb:sf:
33) *DEC Digital 75-dot matrix --------------------------------------------
dec|digital|Digital|la-75 dot matrix: :lp=/dev/larry: :sd=/var/spool/digital: :lf=/var/spool/digital/log-file: :br#4800: :pl#58;pw#80: :fc#0177777: :fs#06320: :if=/usr/lib/lpf: :xc#0177777: :xs#044000: :sh:
34) *DEC LA324 ------------------------------------------------------------
# NOTE: LA324 DEC USER SETUP
# Protocal Should be IBM Instead of DEC
## Decwriter LA324 over a tty line.
dec|LA-324|decwriter: :br#9600: :lp=/dev/ttyb: :fc#0177777:fs#023: :ms=-parity,-cstopb, clocal, cread, crtscts, ixon, -opost: :sh: :sd=/var/spool/dec
35) *DEC LN03 ------------------------------------------------------------
#This printer uses null-modem cable
#9600 baud,Xon/Xoff,8 data bits
#Do not use "sf" field when not using
#DOS application,otherwise do form
#feed manually.
ln03|Dec ln03 Laser printer
:br#9600: :mx#0:sb:sf:sh: :fc#0177777:xs#004000: :lp=/dev/ttyy02: :sd=/var/spool/ln03: :lf=/var/spool/ln03/ln03.log:
36) *DEC LN03 PostScript --------------------------------------------------
##
## entry for a DECLN03 PostScript Printer
##
lp|ln03|ln03, a serial postscript printer: :lp=/dev/ttya: :lf=/var/spool/lp/log: :sd=/var/spool/lp: :mx#=0: :sf: :sb: :sh: :br#9600: :rw: :fc#0000374: :fs#0000003: :xc#0: :xs#0040040:
37) EPSON EX1000 (over a tty line) ----------------------------------------
#
#
# Epson EX1000 over a tty line.
# Contributed by Paul Leylan
#
lp|epson: :lp=/dev/ttyb: :br#9600:fc#0177777:fs#0000002:xc0177777:xs0040440: :tr=\f:of=/usr/lib/lpf:lf=/usr/adm/lpd-errs:
38) EPSON FOR STSC APL ---------------------------------------------------
#Epson for stsc apl
# epson for stsc apl
11|lp11|pp11|aplepson: :sd=/usr/spool/epson:sh:lf=/usr2/util/.printer.log: :br#4800:fc#0177777:fs#0000000:lp=/dev/tty0b:xc#0177777:xs#000040:
39) EPSON FX-185 -LOCAL -------------------------------------------------
# Local Epson Printer FX-185
# (See entry for VP-130K in Japanese printer section)
#
EPS@|HDCP|ep@|EP|epson: :sd=/usr/spool/epd: :lf=/usr/spool/epd/log:br#9600: :vf=/usr/lib/epson_filter: :if=/usr/lib/epson_text: :fc#192: :pl#66: :sh: :lp=/dev/tty@:mx#1200:
40) EPSON FX-185 -REMOTE -----------------------------------------------
# Remote Epson Printer FX-185
# (See entry for VP-130K in Japanese printer section)
#
EPS@|HDCP|ep@|EP|epson: :lp=:rm=ep@host:rp=ep@:mx#1200: :sd=/usr/spool/epd: :lf=/usr/spool/epd/log:
41) EPSON IN PLOT MODE (raster graphics) -------------------------------
#
# epson in plot mode (raster graphics)
6|lp6|epplot : :sd=/usr/spool/epplot:sh:lf=/usr2/util/.printer.log: :br#4800:fc#0177777:fs#0000040:lp=/dev/tty0b:xc#0177777:xs#000040:
42) EPSON LQ2550 SERIAL ------------------------------------------------
#
#stty info is as follows:
#
#{pita:SUPER-USER:46} stty -a < /dev/ttyb
#speed 4800 baud, 36 rows, 76 columns
#parenb -parodd cs7 -cstopb -hupcl cread -clocal -crtscts
#-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
#ixon -ixany ixoff imaxbel
#isig icanon -xcase echo echoe echok -echonl -noflsh -tostop
#echoctl -echoprt echoke
#opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
#erase kill werase rprnt flush lnext susp intr quit stop eof
# ^? ^U ^W ^R ^O ^V ^Z/^Y ^C ^\ ^S/^Q ^D
#Printcap info:
westlp|lp|epson|Epson: fs#06020:fc#0300:xs#040:br#4800: :lp=/dev/ttyb:tr=\f:sd=/var/spool/westlp: :lf=/usr/spool/westlp/lw-log:
43) EPSON TEXT ---------------------------------------------------------
#
#epson text
1|lp2|pp2|epson: :sd=/usr/spool/epson:lf=/usr2/util/.printer.log: :br#4800:fc#0177777:fs#0006020:lp=/dev/tty0b:xc#0177777:xs#040040:
44) EPSON VP-130K PRINTER ----------------------------------------------
# Remote Epson VP-130K Printer
#
EPS@|HDCP|ep@|EP|Epson VP-130K printer: :lp=:rm=ep@host:rp=ep@:mx#1200: :sd=/usr/spool/epd_vp: :lf=/usr/spool/epd_vp/log:
45) EPSON VP-130K PRINTER -LOCAL -----------------------------------------
# Local Epson VP-130K Printer
#
EPS@|HDCP|ep@|EP|Epson VP-130K printer: :lp=/dev/tty@:mx#1200: :br#9600:fc#192:pl#66:sh: :sd=/usr/spool/epd_vp: :lf=/usr/spool/epd_vp/log: :if=/usr/lib/epson_ktext: :vf=/usr/lib/epson_vpk:
46) ERICSSON 4156 -------------------------------------------------------
#
lp|4156|Ericsson 4156: :lp=/dev/tty00:fo:br#2400:fc#0177777:fs#06220:pl#66:pw#80: :sd=/usr/spool/lpd:if=/usr/lib/lpf:lf=/usr/adm/lpd-errs:tr=\f:
47) ERICSSON 4160 --------------------------------------------------------
#
#
lp|4160|Ericsson 4160: :lp=/dev/tty00:fo:br#9600:fc#0177777:fs#06220:pl#66:pw#80: :sd=/usr/spool/lpd:if=/usr/lib/lpf:lf=/usr/adm/lpd-errs:tr=\f\f:
48) ERICSSON 4511 (4512) CENTRONICS --------------------------------------
#
lp|4511C|Ericsson 4511(4512)/Centronics: :lp=/dev/lp0:fo:pl#66:pw#80: :sd=/usr/spool/lpd:if=/usr/lib/lpf:lf=/usr/adm/lpd-errs:tr=\f:
49) ERICSSON 4511 (4512) RS232 ------------------------------------------
#
lp|4511|Ericsson 4511(4512)/RS232: :lp=/dev/tty00:fo:br#9600:fc#0177777:fs#06220:pl#66:pw#80: :sd=/usr/spool/lpd:if=/usr/lib/lpf:lf=/usr/adm/lpd-errs:tr=\f:
50) ERICSSON 5819 CENTRONICS ---------------------------------------------
#
lp|5819C|Ericsson 5819/Centronics: :lp=/dev/lp0:ff=\^\r\n[0!s\r\f:fo:pl#66:pw#80:sd=/usr/spool/lpd: :if=/usr/lib/lpf.5819:lf=/usr/adm/lpd-errs:of=/usr/lib/lpf.5819: :tr=\^\r\n[6~\r\f\f:
51) FACIT LASER P7080 IN DIABLO 630/CENTRONICS --------------------------
#
lp|7080|Facit Laser P7080 in Diablo 630/Centronics: :lp=/dev/lp0: :ff=\E\ESB2,2,12,0,2E,10,2,0.D3,1,6,80,30,8,4.J3W1\E\ET\EF2.\EL3.\f: :pl#66:pw#132:sd=/usr/spool/lpd:if=/usr/lib/lpf: :lf=/usr/adm/lpd-errs:tr=\E\ESJS3R1:
52) FACIT LASER P7080 IN DIABLO 630/RS232 -------------------------------
#
lp|7080|Facit Laser P7080 in Diablo 630/RS232: :lp=/dev/tty00:br#9600:fc#0177777:fs#06020: :ff=\E\ESB2,2,12,0,2E,10,2,0.D3,1,6,80,30,8,4.J1W1\E\ET\EF2.\EL3.\f: :pl#66:pw#132:sd=/usr/spool/lpd:if=/usr/lib/lpf:lf=/usr/adm/lpd-errs: :tr=\E\ESJS3R1:
53) FUJITSU GRAPHICS HARDCOPY DEVICE-------------------------------------
#
# Fujitsu graphics hardcopy device.
#
lpfuji|fuji|RAW: :lp=/dev/lp0:sd=/usr/spool/lpfujid:sh:xs#040:
54) GE TERMINET 340 LINE PRINTER -REMOTE --------------------------------
# Remote GE Terminet 340 Line Printer
#
ge@|GE340|GE Terminet 340: :lp=:rm=ge@host:rp=ge@:
55) GE TERMINET 2120 LINE PRINTER -LOCAL ---------------------------------
# Local GE Terminet 2120 Line Printer
#
ge@|GE2120|GETerminet 2120: :br#1200:fs#1:tr=\f: :sd=/usr/spool/lpd: :lf=/usr/spool/lpd/log: :sf:sh: :lp=/dev/tty@:
56) GE TERMINET 2120 LINE PRINTER -REMOTE --------------------------------
# Remote GE Terminet 2120 Line Printer
#
ge@|GE2120|GE Terminet 2120: :lp=:rm=ge@host:rp=ge@:
57) GE TERMINET 340 LINE PRINTER -LOCAL ----------------------------------
# Local GE Terminet 340 Line Printer
#
ge@|GE340|GE Terminet 340: :lp=/dev/tty@:pl#63:pw#132: :ff=\f:fo:tr=\f:fs#06000:sh:
58) GERBER (OFF-LINE GERBER PLOTTER) -LOCAL ------------------------------
# Local Off-line Gerber plotter (Put Gerber)
#
GRB@|SCGM|GERBER|Gerber offline plotter: :sd=/usr/spool/gerberd: :lf=/usr/spool/gerberd/log: :zf=/cadds/lib/gerberf:sf:sh: :lp=/dev/null:
59) GERBER (OFF-LINE GERBER PLOTTER) -REMOTE
# Remote Off-line Gerber plotter (Put Gerber)
#
GRB@|SCGM|GERBER|Gerber offline plotter: :sd=/usr/spool/gerberd: :lf=/usr/spool/gerberd/log: :lp=:rm=GRB@host:rp=GRB@:
60) HP 2932 LINE PRINTER --------------------------------------------------
# HP 2932 Line printer
hp2932|lw6|line: :lp=/dev/ttya: :rp=lp6: :sd=/var/spool/lw6: :lf=/var/spool/lw6/lw6-log: :pl#66:pw#132: :br#9600:rw:
61) HP 7475 PLOTTER (LONG LISTING)
#
I have had numerous calls in making a plotter work on a 386i serial port whether it is on ttya or the second serial port. There are two common configurations for plotters.
Make sure that the printcap and ypprintcap is the same file as we all know this was a known problem in 4.0.0 for remote printing.
For a plotter with 9600 baud, 7 databits, 1 stop bit, even parity and xon/xoff include the following inthe printcap (common config for autocad):
:br#9600: \ #sets baud rate
:sh:sf: \ #suppresses header and footer
:xs#040000: \ #sends a cntl Q for DTR
:ms=-parityenb,-parityodd,-crtscts,-cstopb,cs7,ixon,-opost: #comm parameters
For a plotter with 9600 baud, 8 databits, 1 stop bit, no parity , and xon/xoff include the following in the printcap:
:br#9600: \ #sets baud rate
:sh:sf: \ #suppresses header and footer
:xs#040000: \ #sends a cntl Q for DTR
:ms=-parity,-crtscts,-cstopb,cs8,ixon,-opost: #comm parameters
Reference: man pages termio on ms options
Most plotters do not utilize pin 8 on the serial cable. The Owner's
Bulletin, pg. 16. advises to put the following in rc.local:
/usr/etc/ttysoftcar -y /dev/tty
There is also a known problem with the serial port that was supposed to
have been fixed in 4.0.1. The serial port prematurely closes before it
is finished plotting. This problem is being worked on with ecd. A
temporary fix is to run the following cat > /dev/tty$; $ should be
replaced witha, m0, or m1 depending on the serial port being used.
This will dedicate a window but this is temporary until a patch can be made.
Also note for those adding second serial ports. The serial port that comes
with the RR does not deal with interrupts thatDOS cares about. This port should be assigned to /dev/ttya at all times. Using /dev/ttym0 the serial port should be assigned interrupt 4 and for /dev/ttym1 should be assigned interrupt 3. Therefore, a total of three serial ports can be added.
Anothernote for AutoCAD users:
There is a problem running a digitizer on a second serial port. Must use digitizer on /dev/ttya and plotters on second serial port. Autodesk is working on this problem.
62) HP 7475A PLOTTER ------------------------------------------------------
#
#
7|lp7|lw7|hp7580|hp7475|plotter|local A/D size HP pen plotter: :lp=/dev/ttya: :mx#0: :br#9600: :sd=/usr/spool/lwd7: :lf=/usr/spool/lwd7/log:
#(assuming the `A' model is not different)
63) HP 7550A PEN PLOTTER -------------------------------------------------
I'll start with the HP 7550A pen plotter. Now keep in mind that these
are suggested workarounds and are not guaranteed, so don't hold me liable
if they do not work. I'm merely relaying information from my customers.
Anyways, the printcap, cabling, and plotter settings that are needed for
this plotter to work on the serial port are the following:
HP 7550A
--------
printcap entry
---------------
hp: :lp=/dev/ttya:br#9600:rm=:rp=hp:sd=/var/spool/hp: :mx#0:sh:sf:ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff:
cabling
-------
a null modem cable or something with pinouts such as:
386i plotter
2-------------3
3-------------2
7-------------7
4---
|
5---
6---
|
8---
|
20---
Plotter
-------
set to 8 bits, no parity, xon/xoff, 9600, standalone, remote
Now we aren't finished yet. In some instances this may be all you need, but
the majority of the time you will still need to type the following command to get the plot to complete:
cat /dev/ttya > /dev/null &
This will be running in the backgroheck ht
power cycle your plotter this process will die and you must retype it in a
commands window. This line can also be started from rc.local at boot up
time.
64) HP 7580 (A SUGGESTION! LONG LISTING) ------------------------------
This workaround was suggested by a VAR and has spooling working fine for his AutoCAD plot files. It consists of using a C program as an output filter that changes some output settings while the plot filegoes through it. He also had to send a file in between plots which actually turned the plotter offline so that the plotter would not start the next plot in the queue on top of the one it just finished. This allows the user to change paper in the plotter, put the plotter back online(manually), and watch
he next plot start up.
His printcap entry looked like the following:
plotter: :sh: :lp=/dev/ttya: :sd=/var/spool/plotter: :of=/home/user1/spf: :lf=/var/adm/plotter_errs:
where user1 is the name of some user with home directory in
/home/user1.
Here is the C program spf.c that he used as the output filter. It must
be compiled first before it can be used. The command line for compiling the
program is: cc -o spf spf.c.
#include
#include
#include
#include "termios.h"
extern void exit();
extern void perror();
struct termios cb;
main(argc, argv)
int argc;
char *argv[];
{
char c;
int n;
long s;
/* get settings for stdout (were only changing a few) */
if(ioctl(1, TCGETS, &cb) == -1) {
perror("1 spf");
exit(2);
}
s = cb.c_cflag;
/* disable parity (was enabled) */
cb.c_cflag &= ~PARENB;
cb.c_cflag |= 0;
/* 8 bit chars (was CS7) */
cb.c_cflag &= ~CSIZE;
cb.c_cflag |= CS8;
if(ioctl(1, TCSETSW, &cb) == -1) {
perror("2 spf");
exit(2);
}
while ((c = getchar()) != EOF)
putchar((char) c);
cb.c_cflag = s;
if(ioctl(1, TCSETSW, &cb) == -1) {
perror("3 spf");
exit(2);
}
exit(0);
}
The other file that gets printed in between plots is just a file thatcontains one HPGL command. It is "NR;", which causes the plotter to become "not ready" so that the paper can be changed. The plotter is
then put back online. So a typical plotting sequence with this method
might look like this:
plot1
/home/user1/nr #file with NR; in it
plot2
/home/user1/nr
plot3
/home/user1/nr
Now remember, this is not guaranteed, only a suggestion.
65) HP 7580 PLOTTER ------------------------------------------------------
7|plotter|hp7580|hp7475|local A/D size HP pen plotter: :lp=/dev/ttya: :mx#0: :br#9600: :sd=/usr/spool/plotter: :lf=/dev/console:
66) HP 7580 PLOTTER -LOCAL -----------------------------------------------
# Local HP 7580 Plotter
#
HP7@|PPLT|hp|HP 7580 Plotter: :lp=/dev/tty@:sd=/usr/spool/hpd: :lf=/usr/spool/hpd/log: :vf=/usr/lib/hpf:sh:sf:br#9600: :gf=/usr/lib/hpf:
67) HP 7580 PLOTTER -REMOTE ----------------------------------------------
# Remote HP 7580 Plotter
#
HP7@|PPLT|HP 7580 Plotter: :lp=:rm=HP7@host:rp=HP7@:sd=/usr/spool/hpd: :lf=/usr/spool/hpd/log:
68) HP 7595 --------------------------------------------------------------
This is a non-roll feed plotter. The method for using this plotter is identical for using the 7550A plotter. One added note to keep in mind: a field called tr can be added to the printcap entry that prints out a trailer string after the plot is finished. This trailer would be the HPGL command 'AF;' which tells the plotter to do a full page advancement before starting the nextplot. Using this method, spooling has worked for some VARs. So the new field in the printcap entry would have the form
:tr=AF;:
and could be put anywhere in the printcap entry for the plotter.
69) HP 7595 DRAFTMASTER --------------------------------------------------
I have received a printcap entry from a VAR who has gotten his
HP 7595 Draftmaster I to work on the ttya, ttym1, and ttym0 serial
ports on the 386i. The AT serial card he has in his 386i is made
by JDR and is called the 286/386 Multi-I/O card(part#MCT-ATIO).
He configured the ports on the card as ttym0 and ttym1. He also had
an upgrade kit for the card called the Serial ATIO kit.
Here's the entry he has gotten all 3 serial ports to work for his plotter:
(His 386i was configured as a standalone, but will be put up on a
network soon):
Note: the lp field can be set to /dev/ttya, /dev/ttym1, or /dev/ttym0.
hpp: :lp=/dev/ttya:br#9600:rm=:rp=hpp:sd=/var/spool/hpp: :mx#0:sf:ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff:
where:
mx#0 => unlimited size for a file
ms =cs7 => 7 character(data) bits
=parenb => parity generation and detection enabled
=-parodd => disable odd parity
^^^^^^^
=-ignpar => characters with framing or parity errors
(other than break) are not ignored.
^^^
=ixon => enable start/stop output control
=ixoff => enable start/stop input control
70) HP 7750A -------------------------------------------------------------
Note that the HP 7750A can be programmed to use XON/XOFF by sending the
sequence "\033.P1:" or byfront panel selections.
#
# HP pen plotter, connected locally, running at 9600 baud
#
hp|hpplotter|hp7550A|Hewlett-Packard pen plotter in 1E404: :lp=/dev/tty02:sd=/usr/spool/hp: :lf=/usr/spool/hp/log:af=/usr/spool/hp/acct: :br#9600:fc#0377:fs#0221:mx#0: :rw:sh:sb:fo: :ff=\033.J\033.P1\:\033.T\:\nPG;\n: :of=/usr/local/lib/vp/hpfilter:
#
Note that the HP 7750A can be programmed to use XON/XOFF by sending the
sequence "\033.P1:" or by front panel selections.
71) HP GENERIC ----------------------------------------------------------
# @(#)printcap.hp 1.2 4/17/85
#
# Inca Printers
#
hp|lp|tjtest: :br#9600:lp=/dev/ttya:fs#06021:of=/usr/erh/inca/bin/sd.hp: :lf=/usr/adm/lpd-errs:fc#0777:pl#60:xc#07737:xs#040:sd=/usr/spool/hp:
ep|epson|Epson printer: :lp=:rm=apollo:rp=ep:sd=/usr/spool/ep:
72) *HP III ---------------------------------------------------------------
hp|HP III: :mx#0:br#19200:sf:sb: :xc#0177777: :ms=-parity,ixon,-opost: :lp=/dev/lpvi0: :sd=/var/spool/hp: :lf=/var/spool/hp/log: :af=/var/spool/hp/acct: :if=/usr/local/products/newsprint/lpd/if: :gf=/usr/local/products/newsprint/lpd/gf: :nf=/usr/local/products/newsprint/lpd/nf: :tf=/usr/local/products/newsprint/lpd/tf: :rf=/usr/local/products/newsprint/lpd/rf: :vf=/usr/local/products/newsprint/lpd/vf: :cf=/usr/loc
l/products/newsprint/lpd/cf: :df=/usr/local/products/newsprint/lpd/df: :of=/usr/local/products/newsprint/lpd/of:
73) HP LASERJET -----------------------------------------------------------
# HP LaserJet.
# If you're using the LaserJet's serial port, the port should be configured
# to use the RS-422 interface (it uses the RS-232 interface by default).
# The LaserJet User's Manual says we should talk to the serial port
# in the following manner:
#
# no parity, 8 bits, 1 stop bit, xon/xoff enabled, rts/cts enabled
#
# Also note that the output filter is called to output an escape sequence
generic_hp: :pw#80: :ms=-parity,-cstopb,-clocal,-cread,crtscts,ixon,-opost:of=/usr/lib/hplaserjet:
#
74) HP LASERJET (LONG LISTING) -------------------------------------------
# HP LaserJet.
# If you're using the LaserJet's serial port, the port should be configured
# to use the RS-422 interface (it uses the RS-232 interface by default).
# The LaserJet User's Manual says we should talk to the serial port
# in the following manner:
#
# no parity, 8 bits, 1 stop bit, xon/xoff enabled, rts/cts enabled
#
# Also note that the output filter is called to output an escape sequence
generic_hp: :pw#80: :ms=-parity,-cstopb,-clocal,-cread,crtscts,ixon,-opost:of=/usr/lib/hplaserjet:
#
---------------------- cut here -------------------------
The necessary line printer filter to use.
---------------------- cut here -------------------------
#!/bin/csh -f
#
# @(#)hplaserjet 1.1 88/10/27 Sun MicrosystemsInc 1988
#
#
# This is the output filter form use with HP laserjets I and II.
# It is called via the of entry in the generic_hp printcap entry
# All it does is send the escape sequence to the printer, so that:
# CR is mapped to CR
# LF is mapped to CR LF
# FF is mapped to CR FF
# note that on the next line the "^[" is a real escape character
# just in case it gets lost in the mail (if this is mailed)
/usr/bin/echo -n '&k2G'
/usr/bin/cat
if ($status == 0) then
exit 0
else
exit 1
endif
75) HP LASERJET IIP, IID (PC-NFS OK) --------------------------------------
There are a couple of new models of hplaserjet; Model IIP and IID. The
following printcap works with the hplaserjet on a sparcstation1.
Note that you need to use a filter to remap unix files to dos format.
This filter can be found on the Sun386i under /usr/lib/hplaserjet.
My customer has also tested it with pcnfs and says it works great.
inter: :lp=/dev/ttya:sd=/var/spool/inter:br#9600:rm=intcad:rp=inter: :fs#06021:fc#0777:sb:sh:sf:xc#07737:xs#040:of=/usr/lib/hplaserjet:
76) HP LASERJET PLUS!! (THIS IS A VERY LONG LISTING!!) -------------------
1. A new printcap entry is needed. The generic_hp entry in the /etc/ypprintcap
file on the yp master should read as follows:
generic_hp: :pw#80: :ms=-parity,-cstopb,-clocal,-cread,crtscts,ixon,-opost:of=/usr/lib/hplaserjet:
2. Install the file at the end of this message into /usr/lib as hplaserjet by:
mount -o remount /usr
cp hplaserjet /usr/lib
chmod 555 /usr/lib/hplaserjet
3. Decide which interface you are going to use - serial or parallel port
4. Connect the printer to the 386i with the appropriate cable
5. Configure your hplaserjet to use the serial port or parallel port by using
the printer manual. For the laserjet II, its called "Getting Started with the
LaserJet series II printer", HP Part number (on the bottom right hand corner)
is 33440-90908.
For the serial port, use instructions on pages
3-7 and 3-8. NOTE that you must configure the printer to use the RS-422
interface.
For the parallel port, use instructions on pages 3-9
6. use SNAP to add the printer:
- use 9600 if the serial port is chosen
- choose laserjet as the printer type.
Printing
========
(Asumming you set up the printer to be lp above)
>From Unix, use lpr to print files
>From DOS, make sure that the setup.pc line in your ~pc directory
has:
LPT1: lpr
print to this using the DOS print command and LPT1: as the printer
The HPLASERJET file:
====================
Cut below the ---- line for the hplaserjet file mentioned in step 2
-------------------------------------------------------------------
#!/bin/csh -f
#
# @(#)hplaserjet 1.1 88/10/27 Sun Microsystems Inc 1988
#
#
# This is the output filter form use with HP laserjets I and II.
# It is called via the of entry in the generic_hp printcap entry
# All it does is send the escape sequence to the printer, so that:
# CR is mapped to CR
# LF is mapped to CR LF
# FF is mapped to CR FF
/usr/bin/echo -n 'k2G'
/usr/bin/cat
if ($status == 0) then
exit 0
else
exit 1
endif
...........Here is some more hope it helps...............
Here it is, courtesy of Cal Thixton (thanks Cal, if you're still
alive?). He wrote 2 printcaps, one for normal mode, one for graphicsmode. I have also included his raster print program for printing
screendumps, which includes the graphics mode printcap as a comment..
>>>>>>>>>>>>>> Cal's HP laserjet Printcaps >>>>>>>>>>>>>>>>>>>lp|This is for normal printing of text files: :br#9600:lp=/dev/ttya:fs#06021:of=/usr/lib/lpf.hp: :lf=/usr/adm/lpd-errs:fc#0777:sb:sh:pl#60:sf:
tp|This is for printing graphics dumps: :br#9600:lp=/dev/ttya:fs#06021:of=/usr/lib/lpf.tp: :lf=/usr/adm/lpd-errs:fc#0777:sb:sh:pl#60:xc#07737:xs#040:sf:
write a script: this is /usr/lib/lpf.hp
#! /bin/sh
echo -n ^[\&k1G
cat | tr '\012' '\015'
echo -n ^L
echo -n ^[E
exit 0
and: this is /usr/lib/lpf.tp
#! /bin/sh
cat
echo -n ^L
echo -n ^[E
exit 0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>> Cal's HP laserjet screendump printing filter >>>>>>>>>#include
#include
/*
* This is a filter for hp laserjet printers. this
* expects to be fed by something like screendump.
* Make sure your braindamaged hp has more than 50k
* in it, else you'll be getting this print on
* three pages, if you're lucky. when the 256k version
* comes out, things will be better.
* Use a printcap entry like:
* # HP Laserjet printer
* tjhpbit|hpbit: * :br#9600:lp=/dev/ttya:fs#06021:of=/usr/lib/sd.hp: * :lf=/usr/adm/lpd-errs:fc#0777:sb:sh:pl#60:xc#07737:xs#040:sf:
*
*/
main()
{
struct rasterfile r;
int i,j;
char buffer[BUFSIZ*4];
if(read(0, &r, sizeof(r)) != sizeof(r)) {
perror("mishap");
exit(1);
}
setbuffer(stdout, buffer, BUFSIZ*4);
printf("\033E"); /* reset */
printf("\033*t150R"); /* 100 DPI */
printf("\033&k1H"); /* horiz spacing */
for(i=0 ; i < r.ras_height ; i++) {
printf("\033*r0A"); /* Start raster */
printf("\033*b%dW", r.ras_width/8);
for(j=0 ; j < (r.ras_width/8); j++)
printf("%c", getchar());
printf("\033*rB"); /* Stop raster */
printf("\033&a0H"); /* horiz 0 */
}
printf("\f"); /* formfeed */
printf("\033E"); /* reset */
fflush(stdout);
}
-------------------------------------------------------------------------
I wrote a screen dump for a HP Laserjet printer, but unless you get
the new printers with 1/4meg, then you would get your screendump on
up to 3 separate pages. the HP has problems and it is not very smart.encourage the purchase of an apple.
cal
#ifndef lint
static char sccsid[] = "@(#)sd.hp.c 1.2 4/17/85";
#endif
#include
#include
#include
#include
/*
* This is a filter for hp laserjet printers. this
* expects to be fed by something like screendump.
* Make sure your braindamaged hp has more than 50k
* in it, else you'll be getting this print on
* three pages, if you're lucky. when the 256k version
* comes out, things will be better.
* Use a printcap entry like:
* #HP Laserjet printer
* tjhpbit|hpbit: * :br#9600:lp=/dev/ttya:fs#06021:of=/usr/lib/sd.hp: * :lf=/usr/adm/lpd-errs:fc#0777:sb:sh:pl#60:xc#07737:xs#040:sf:
* everything read will be copied to stdout till the
* magic number for a rasterfile is encountered, then
* it will do its thing. tabs are also expanded
* correctly.
*/
main(argc, argv)
int argc;
char *argv[];
{
struct rasterfile r;
int i,j,k,l,m,n, col;
char *q, *p[8], send[32], c, *malloc();
char buffer[BUFSIZ*4];
flock(fileno(stdout), LOCK_EX);
setbuffer(stdout, buffer, BUFSIZ*4);
while(1) {
printf("\033&l0O");
printf("\033(8U");
printf("\033(s0p16.66h8.5v0s0b0T");
printf("\033&k3G");
printf("\033&a13L");
fflush(stdout);
for(m=RAS_MAGIC, q=(char *) &m,i=col=0; i < sizeof(m);) {
if(((n = getchar()) & 0xff) == (q[i] & 0xff)) {
i++;
continue;
}
if(n == EOF && feof(stdin)) {
fflush(stdout);
fclose(stdout);
exit(0);
}
if(i)
putchar(q[i=0]);
switch(n) {
case '\t':
for(i=8-(col%8); i; i--)
putchar(' ');
col = 0;
break;
case '\r':
case '\n':
case '\f':
col = 0;
putchar(n);
case '\033':
break;
default:
putchar(n);
col++;
}
}
j = sizeof(r) - sizeof(int);
q = (char *) &r;
if(fread(q + sizeof(int), j, 1, stdin) != 1) {
perror("mishap");
exit(1);
}
/* get extra bits per line */
k = ((((r.ras_width + 15) / 16) * 16) - r.ras_width); if (k>7) {
k -= 8;
l = 1;
}
else
l = 0;
printf("\033*t150R"); /* 100 DPI */
printf("\033&k1H"); /* horiz spacing */
#define SPACE_OVER 11 /* 11 * 8 = 72pixels ~ .75 inch */
for(i=0 ; i < r.ras_height ; i++) {
printf("\033*r0A"); /* Start raster */
printf("\033*b%dW", ((r.ras_width + k)/8) + SPACE_OVER);
for(j=0 ; j < SPACE_OVER; j++)
putchar(0);
for(j=0 ; j < (r.ras_width/8); j++)
if((n = getchar()) == EOF && feof(stdin))
exit(0); /* throw away a byte */
else
putchar(n);
if(k)
if((n = getchar()) == EOF && feof(stdin))
exit(0); /* throw away a byte */
else
putchar(n & (0xff << (k-1))); /* zero unwanted bits */
if(l) {
if((n = getchar()) == EOF && feof(stdin))
exit(0); /* throw away a byte */
if(!k)
putchar(n);
}
printf("\033*rB"); /* Stop raster */
printf("\033&a0H"); /* horiz 0 */
}
printf("\f"); /* formfeed */
fflush(stdout);
}
}
sigTERM()
{
printf("\f");
printf("\033E"); /* reset */
fflush(stdout);
exit(0);
}
77) HP LASERJET PRINTERS & 386i (LONG LISTING) ---------------------------
Recently on sun-spots and various other places I have seen many people
trying to configure HP Laserjet printers to run on their sun systems.
On the 386i we have aready solved this problem with the following
printcap entry and a special printer filter. This filter and printcap entry
also work on a 3/260 using and HP colorjet printer.
Onenote of caution, make sure that your customer reads the manual for the
printer and has the proper cable, the HP laserjets will NOT work on a null
modem cable.
/etc/printcap entry is as follows:
---------------------- cut here -------------------------
###############
# HP LaserJet.
# If you're using the LaserJet's serial port, the port should be configured
# to use the RS-422 interface (it uses the RS-232 interface by default).
# The LaserJet User's Manual says we should talk to the serial port
# in the following manner:
#
# no parity, 8 bits, 1 stop bit, xon/xoff enabled, rts/cts enabled
#
# Also note that the output filter is called to output an escape sequence
generic_hp: :pw#80: :ms=-parity,-cstopb,-clocal,-cread,crtscts,ixon,-opost:of=/usr/lib/hplaserjet:
#
---------------------- cut here -------------------------
The necessary line printer filter to use.
---------------------- cut here -------------------------
#!/bin/csh -f
#
# @(#)hplaserjet 1.1 88/10/27 Sun Microsystems Inc 1988
#
#
# This is the output filter form use with HP laserjets I and II.
# It is called via the of entry in the generic_hp printcap entry
# All it does is send the escape sequence to the printer, so that:
# CR is mapped to CR
# LF is mapped to CR LF
# FF is mapped to CR FF
# note that on the next line the "^[" is a real escape character
# just in case it gets lost in the mail (if this is mailed)
/usr/bin/echo -n '&k2G'
/usr/bin/cat
if ($status == 0) then
exit 0
else
exit 1
endif
.........
HP_Laserwriter for TOPS/Sun
Sample of a TOPS/Sun printcap entry:
*Note you must have the TOPS/Sun software installed.
(printing from your Sun to a Laserwriter on LocalTalk)
Printcap entry:
lp|lw|LaserWriter|NameThatTune@TechServices: :lp=/dev/lw: :sd=/var/spool/lw: :lf=/var/spool/lw/lw-log: :if=/usr/local/lib/lw/topslwprint.sh: :af=/var/adm/lw.acct:
Printcap entry with transcript:
# PostScript printer
lw|lp|PostScript|lp0|ps|postscript|purple|Purple Top@Engineering: :lp=/dev/lw: :sd=/var/spool/lw: :lf=/var/spool/lw/lw-log: :br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:mx#0:sf:sb: :if=/usr/local/lib/lw/psif: :of=/usr/local/lib/lw/psof: :gf=/usr/local/lib/lw/psgf: :nf=/usr/local/lib/lw/psnf: :tf=/usr/local/lib/lw/pstf: :rf=/usr/local/lib/lw/psrf: :vf=/usr/local/lib/lw/psvf: :cf=/usr/local/lib/lw/pscf: :df=/usr/
ocal/lib/lw/psdf:
78) *HP Laserjet II/III ----------------------------------------------------
Printing to an HP LaserJet II/III Printer with SunOS 4.x
==========================================================
Here is a step-by-step procedure for setting up the HP LaserJet printer to
print from Sun Microsystems workstations. Although Sun Microsystems, Inc.
provides these steps for the HP LaserJet, the printer is not officially supported.
1. Edit /etc/ttytab and ensure that the following entry is set for
the tty port that you are connecting the HP to. Assumed that
the printer is connected to ttya.
ttya "/usr/etc/getty std.9600" unknown off secure (4.0 - 4.0.3 SunOS)
or
ttya "/usr/etc/getty std.9600" unknown off local secure (4.1-4.1.x SunOS)
2. Edit /etc/printcap and add the following entry:
lp|hp|hplj|HP_LaserJet: :lp=/dev/ttya:sd=/var/spool/hp: :br#9600:tr=\f:mx#0:sh: :ms=-parity,-cstopb,-clocal,-cread,ixon,-opost: :of=/usr/lib/hplaserjet:
3. Create a directory in /var/spool called hp
4.Create the following file in /usr/lib called hplaserjet:
#!/bin/csh -f
#
# @(#)hplaserjet 1.1 88/10/27 Sun Microsystems Inc 1988
# This is the output filter form used with HP LaserJet II.
# All it does is send the escape sequence to the printer, sothat:
# CR is mapped to CR
# LF is mapped to CR LF
# FF is mapped to CR FF
/usr/bin/echo -n 'k2G'
/usr/bin/cat
if ($status == 0) then
exit 0
else
exit 1
endif
NOTE: Before the characters k2G perform the following commands in "vi":
CTRL- v CTRL-[ & (In insert mode: Press the CTRL key and the v key at
the same time, then let go. Do the same for CTRL - [ then type &)
*CTRL- v is a "vi" specific command to imbed an escape code into the file.
/usr/bin/echo -n '^[&k2G' This is how you would see it in "vi"
/usr/bin/echo -n 'k2G' This is how you would see it by doing
a cat of hplaserjet
This is a good check to make sure the escape characters are inserted
correctly.
6. Type
$lpc restart lp
$lpc up lp
Now you can lpr a test file.
7. If for some reason lpr does not print a file try the following process
to test the connection between the computer and the printer:
a. Type this command: (stty -parity 9600; cat /etc/motd) > /dev/ttya
b. On the HP printer, eject the current page by taking the printer off
line, pressing FF and then placing printer back on line. A page
should have ejected with at least one line of information.
8. If the above steps didn't work, then verify the printcap entries with the
hplaserjet file. Make sure that the permissions are set correctly on all
of the files, spool directory, and serial device. If the above steps did
not work, then check the cable between the Sun and the printer. The basic
cable should be setup like this:
2 -------- 3
3 -------- 2
7 -------- 7
9. The HP LaserJet should be setup in the factory default settings as follows:
RS232 mode enabled
Baud Rate=9600
DTR Polarity=HI
I/O=Serial
Robust XON=ON
* hardware flow control is not listed for setup.
79) *HP Laserjet si - Filters --(LONG FILE)--------------------------------
Here are the filters - just write them to files, complie and edit your printcap to point to them for the in & out filters.
NOTE: The hpIII also works for series II and the old original.
##################
# out_hpIII.c
####################
/*
This is used to print out the header page.
This module should be the output filter in printcap.
The input filter should be in_hpIII.
BOTH filters must be in printcap
This filter is for the HPLASER SERIES III
It starts by sending standard reset (E) to the printer
Laser jet expects to see CRLF on ascii files so we map LF
to CRLF until we see an escape character. The escape char
will be used by some word processer to reset fonts etc...
From that time on just
get a char then print a char
get a char then print a char
get a char then print a char
etc...
*/
#include
#include
#include
#define ESCAPE 27 /* Escape character (decimal) */
#define SMILEY 1 /* SOH char */
int
main(argc, argv)
int argc;
char *argv[];
{
register char
c, /* incoming char */
binary, /* 0 until first binary char found */
done, /* 1 when at end of file */
got_cr; /* 0 until we find cr */
fputs("\033E",stdout); /* put out standard reset */
done = 0;
while (!done){
switch (c=getchar()) {
case EOF:
exit(0);
case '\n':
if (!got_cr){
fputc('\r',stdout);
got_cr = 0;
}
break;
case '\r':
got_cr++;
break;
case '\031': /* end if header call input filter */
if ((c = getchar()) == '\1'){
fflush(stdout);
kill(getpid(), SIGSTOP);
break;
}else{
ungetc(c,stdin);
c = '\031';
}
default:
got_cr = 0;
break;
}
if (c != SMILEY) {
fputc(c,stdout);
}
}/* while */
exit(0);
}
##############
# in_hpIII.c
##############
/*
This filter should be set up as the input filter in printcap
The input filter is used to print out the actual file, the output
filter is used to print out the header page
The filter out_hpIII should be setup as the output filter for
the same printer
BOTH filters should be in printcap
This filter is for the HPLASER SERIES III
It starts by sending standard reset (E) to the printer
Laser jet expects to see CRLF on ascii files so we map LF
to CRLF until we see an escape character. The escape char
will be used by some word processer to reset fonts etc...
From that time on just
get a char then print a char
get a char then print a char
get a char then print a char
etc...
*/
#include
#include
#include
#define ESCAPE 27
int
main(argc, argv)
int argc;
char *argv[];
{
register int
c, /* incoming char */
binary, /* 0 until first binary char found */
done, /* 1 when at end of file */
got_cr; /* 0 until we find cr */
binary = done = 0;
while (!done){
switch (c=getchar()) {
case EOF:
done++;
break;
case '\n':
if (!binary){
if (!got_cr){
fputc('\r',stdout);
got_cr = 0;
}
}
break;
case '\r':
got_cr++;
break;
case ESCAPE:
binary++;
break;
default:
got_cr = 0;
break;
}
if (!done) fputc(c,stdout);
}/* while */
fputs("\033E",stdout); /* put out standard reset */
exit(0);
}
################
# land_in_hpIII.c
################
/*
This filter should be set up as the input filter in printcap.
The input filter is used to print out the actual file, the output
filter is used to print out the header page.
The filter out_hpIII should be setup as the output filter for
the same printer.
BOTH filters should be in printcap.
This filter is for the HPLASER SERIES III. (It has beentested.)
It starts by sending standard reset (E) to the printer and it follows
by sending the codes for landscpae compressed. Use this filter in another
printcap entry for the same printer so that people can get their jobs
printed sideways without changing the application. This works great for
database reports and spreadsheets!
This file modified to send the escape codes to call up landscape
orientation and the compressed "line printer" font.
Laser jet expects to see CRLF on ascii files so we map LF
to CRLF until we see an escape character. The escape char
will be used by some word processer to reset fonts etc...
From that time on just
get a char then print a char
get a char then print a char
get a char then print a char
etc...
*/
#include
#include
#include
#define ESCAPE 27
int
main(argc, argv)
int argc;
char *argv[];
{
register int
c, /* incoming char */
binary, /* 0 until first binary char found */
done, /* 1 when at end of file */
got_cr; /* 0 until we find cr */
binary = done = 0;
while (!done){
switch (c=getchar()) {
case EOF:
done++;
break;
case '\n':
if (!binary){
if (!got_cr){
fputc('\r',stdout);
got_cr = 0;
}
}
break;
case '\r':
got_cr++;
break;
case ESCAPE:
binary++;
break;
default:
got_cr = 0;
break;
}
if (!done) fputc(c,stdout);
}/* while */
fputs("\033&l1o\033(s16.66H",stdout); /* put out standard reset */
exit(0);
}
80) HP PAINTJET XL -------------------------------------------------------
I have a printcap that works for ARIES softwarerunning
on a SPARCstation1 serial port for printing graphics
images only! The images are created by the ARIES HP PaintJetXL
driver software, and are printed on an HP PaintjetXL.
DIP switch settings on the HP PaintJet XL were:
ddduudd where "d" is down and "u" is up
These DIP settings correspond to 9600 baud, even parity, XON/XOFF.
lp|pjet|Hewlett-Packard PaintjetXL printer: :lp=/dev/ttya:sd=/var/spool/pjet: :ms=pass8,-opost,-onlcr,ixon,ixoff:
.........
For HP plotters, we find that the following settings are usually helpful:
1. The latest serial port patch for 4.0.1 or 4.0.2
2. The same printcap entry as above.
3. Plotter settings:
HP7595 Draftmaster I and HP7596 Draftmaster II
----------------------------------------------
Serial:
Dataflow= Remote, Standalone
Baud=9600
Hardwire=on/off
HP/IB=Address 05
Bypass=off
Duplex=full
Auto-disc=off
Similar settings work on the other HP plotters such as the 7580 and 7585.
81) HP THINKJET ----------------------------------------------------------
here's the thinkjet one but it needs a bodge script in order to set the line characteristic correctly.
the script is
+++++++++++++++++++++++++ CUT HERE+++++++++++++++++++
#!/bin/sh
sleep 1500 >/dev/ttyb &
stty cs7 ixoff ixon >/dev/ttyb
lpr -Plocal $1
+++++++++++++++++++++++++++++++++++++++
and the printcap entry...
++++++++++++++++++++++++ CUT HERE ++++++++++++++++++++++++++++
thinkjet: :lp=/dev/ttyb:sd=/usr/spool/local: :lf=/usr/spool/local/lw-log:af=/usr/adm/lw.acct: :br=9600:fs#06320:sh:
82) *HPLJII --------------------------------------------------------------
have also included his raster print program for printing
-- screendumps, which includes the graphics mode printcap as a comment..
-- >>>>>>>>>>>>>> Cal's HP laserjet Printcaps >>>>>>>>>>>>>>>>>>>
-- lp|This is for normal printing of text files:-- :br#9600:lp=/dev/ttya:fs#06021:of=/usr/lib/lpf.hp:-- :lf=/usr/adm/lpd-errs:fc#0777:sb:sh:pl#60:sf:
-- write a script: this is/usr/lib/lpf.hp
-- #! /bin/sh
-- echo -n ^[\&k1G
-- cat | tr '\012' '\015'
-- echo -n ^L
-- echo -n ^[E
-- exit 0
It does work. I used this:
text|hp2|HP Laserjet II Normal text files only: :br#19200:lp=/dev/ttya:fs#06021:of=/usr/local/bin/hpfilter: :sd=/var/spool/hp2: :lf=/var/spool/hp2/log: :fc#0777:sb:sh:pl#60:sf:
83) IBM PROPRINTER ------------------------------------------------------
#
# printcap entry for IBM ProPrinter attached to serial port of Sun
3/60.
#
# The IBM Proprinter requires a parallel to serial converter and
# an cable of the following configuration:
#
#
Sun
| 2 3 4 5 6 7 20 |
|________________|
| | |
| | |
\ / |
/ \ _
| | / \ / | ------------------
| 2 3 4 5 6 7 20 |
| |
Proprinter
Pins 2 to 3, 3 to 2, 7 to 7, 4 to 5 on ProPrinter side,
and6 to 20.
mylw|carl|IBMcarl: :lp=/dev/ttya:\ # serial port on Sun
:br#9600:\ # baud rate
:fs#06021:\ # automatic flow control...xon/xoff
:tr=\f: :of=/usr/lib/lpf:\ # output filter
:sd=/usr/spool/mylw:\ # spooling directory
:lf=/usr/spool/mylw/errs: # log file
84) IMAGEN LASER PRINTER -LOCAL -------------------------------------------
# Imagen Laser Printer
#
ip|imp|imagen|Imagen serial printer: :lp=/dev/imprint: :sd=/usr/spool/ipd: :lf=/usr/spool/ipd/ilog: :af=/usr/adm/imprint-accnt: :br#9600: :cf=/usr/local/lib/icif: :df=/usr/local/lib/idvi: :fc#0177777: :ff=\00: :fo: :fs#040: :gf=/usr/local/lib/igraph: :if=/usr/local/lib/ipf: :mx#10000: :nf=/usr/local/lib/idimp: :pl#60: :pw#80: :px#2016: :py#2624: :rf=/usr/local/lib/ifort: :rw:
:sb: :sc: :sh:st=/usr/spool/ipd/status: :tf=/usr/local/lib/icat: :vf=/usr/local/lib/imp:
85) IMAGEN LASER PRINTER -REMOTE ----------------------------------------
# Remote Imagen
#
ip@|Imagen laser printer: :lp=: :sd=/usr/spool/ipd: :lf=/usr/spool/ipd/ilog: :af=/usr/adm/imprint-accnt:
86) LASERWRITER PLUS (GENERIC) -----------------------------------------
0|lp|lw|ps|purchprint|crackle|PostScript|LaserWriter|laserwriter|postscripta|App le: :lp=/dev/lw:br#9600: :fc#0000374:fs#0000003:xc#0:xs#0040040:rw: :if=/usr/doctools/lib/psif:of=/usr/doctools/lib/psof: :gf=/usr/doctools/lib/psgf:nf=/usr/doctools/lib/psnf: :tf=/usr/doctools/lib/pstf: :vf=/usr/doctools/lib/psvf: :sd=/usr/spool/lpd0:lf=/usr/spool/lpd0/log: :mx#0:sf:sb:
87) LASERWRITER PLUS --------------------------------------------------
0|lp|lw|ps|purchprint|crackle|PostScript|LaserWriter|laserwriter|postscripta|Apple: :lp=/dev/lw:br#9600: :fc#0000374:fs#0000003:xc#0:xs#0040040:rw: :if=/usr/doctools/lib/psif:of=/usr/doctools/lib/psof: :gf=/usr/doctools/lib/psgf:nf=/usr/doctools/lib/psnf: :tf=/usr/doctools/lib/pstf: :vf=/usr/doctools/lib/psvf: :sd=/usr/spool/lpd0:lf=/usr/spool/lpd0/log: :mx#0:sf:sb:
88) LW II IN DIABLO MODE -------------------------------------------------
Customer needed tomake LaserWriter II work in Diablo mode.
The cusomter could cat a file to the printer fine, but when lpr'ing the
file did not receive the proper CR/LF sequence. I had the customer change
his printcap entry to the following and it worked! (I hit the floor in
shock).
lp: :lp=/dev/ttya: :lf=/var/spool/lp: :br#9600:pw#80:fs#06020:fc#0300:xc#040:
89) MONOTYPE LASERCOMP TYPESETTER ---------------------------------------
#
/etc/printcap
# Monotype Lasercomp for Vision Control.
#
lc|lasercomp: :lp=/dev/ttyb:fc#0177777:fs#0300:xs#040040:br#9600:
#
#
add lines to /etc/rc.boot
cp /dev/ttyb /dev/null &
90) NEC LC 890 ---------------------------------------------------------
#
# HP pen plotter, connected locally
#
hp|hpplotter|hp7550A|Hewlett-Packard pen plotter in 1E404: :lp=/dev/tty02:sd=/usr/spool/hp: :lf=/usr/spool/hp/log:af=/usr/spool/hp/acct: :br#9600:fc#0377:fs#0221:mx#0: :rw:sh:sb:fo: :ff=\033.J\033.P1\:\033.T\:\nPG;\n: :of=/usr/local/lib/vp/hpfilter:
91) NEC LC890 (it works!) ---------------------------------------------
We use the following printcap entry for postscript printing with our NEC LC890
printer (with Frame software):
# POSTSCRIPT PRINTER
lw|ps|postscript|PostScript: :lp=/dev/ttya: :sd=/usr/spool/ps: :lf=/dev/console: :br#9600: :rw: :fc#0000374: :fs#0000003: :xc#0: :xs#0040040: :mx#0: :sf: :sh:
When we wantto use the LC-890 in Laserjet mode, we use the following:
#LASERJET PRINTER
hp|hplaserjet: :lp=/dev/ttya: :sd=/usr/spool/lj: :br#9600:mx#0: :fc#0300: :fs#00020: :sh:lf=/usr/adm/lpd-errs:
92) *NEC SILENTWRITER (VERY LONG LISTING) ---------------------------------
The following Printcap and filters should work fine for your SilentWriter.
printcap:
charlie: :ts=X00860B: :op=PORT_1: :br#9600: :fc#0177456: :fs#0000321: :lf=/usr/adm/lat1err: :sd=/nfs/spool/charlie: :lp=/dev/tty08: :if=/nfs/lpdfilters/qms_tty08: :rw=true: :sf: :sh: :mx#0: :xc#077737: :xs#000040:
Filters:
/******************************************************************/
/* IMPORTANT ***************SEE qms_ttyXX.h **********************/
/* The following include MUST be changed to point at the correct */
/* include file for this printer */
#include "qms_ttyXX.h" /* Modify for correct tty port */
/* SEE qms_ttyXX.h FOR MORE DETAILS *******************************/
/******************************************************************/
/* Filter for Qms printers */
/* The Qms printers return error messages if there is */
/* something wrong with the printer or the file to be printed */
/* This filter will analyze the errors and attempt to print job */
/* successfully */
/* If a job was flushed we will attempt to print again because */
/* a garbled byte from a communication failure to the printer may */
/* have caused problem. If the job flushes twice we assume we */
/* got a bad postscript file and exit */
/* If a job could not be printed because the printer failed */
/* ie... outof paper etc ... then we will keep trying to print job */
/* until printer error is resolved */
#include "qmsfilt.h" /* All includes and defines */
FILE *log; /* Completion status log file */
main(argc, argv)
char *argv[];
{
char *curtime; /* buffer for time stamp
*/
char crfile[80],*curfile = &crfile[0]; /* print command file */
char prfile[80],*purfile = &prfile[0]; /* print file */
char *username; /* print job sender */
char *host; /* job host */
char *cp; /* general pointer */
char *acctfile; /* accounting file */
int retry = 0; /* number of tries printing job */
int errlin = 0; /* Error returned from getlperr */
int pos;
char et = EOT; /* see defines */
char buff[NBYTES], *buf = &buff[0]; /* read buffer */
int job_name = 0; /* Non zero after job name found */
int user_name = 0; /* Non zero after job sender found */
FILE *spfile;
long tlong;
int getlperr();
int i;
int siz = 0; /* bytes read */
int pr; /* print file descriptor */
intalfp; /* device file descriptor */
extern int errno;
/* MAIN */
/*------------------------------------------------------*/
/* get args from lpd */
/*------------------------------------------------------*/
while (--argc){
if (*(cp = *++argv) == '-'){
switch (cp[1]){
case 'n': /* username of sender */
argc--;
username = *++argv;
break;
case 'h': /* hostname */
argc--;
host = *++argv;
break;
default: /* ignore rest */
break;
}
}else{
acctfile = cp; /* accountinf file */
}
}
/* ----------------------------------------------------------*/
/* get current time for completion log */
/* ----------------------------------------------------------*/
time(&tlong);
curtime = ctime(&tlong);
curtime += 4; /* point to Month */
*(curtime + 16) = '\0'; /* end after time */
/* ----------------------------------------------------------*/
/* open completion error log file */
/* open completion error log file */
/* if open fails printer will not work */
/* ----------------------------------------------------------*/
if ((log = fopen(LOGFILE,"a")) == NULL){
exit(0);
}
/* ----------------------------------------------------------*/
/* open device (tty) that printer is attached to */
/* ----------------------------------------------------------*/
if ((alfp=open(DEV,O_RDWR,NULL)) == BAD){
fprintf(log,"%s printer open error\n",curtime);
exit(0);
}
/* ----------------------------------------------------------*/
/* open lock file which contains name of print command file */
/* read name of file , store in curfile */
/* close lock file */
/* ----------------------------------------------------------*/
if ((spfile = fopen("lock","r")) == NULL){
exit(0);
}
curfile = fgets(curfile, 512, spfile);
curfile = fgets(curfile, 512, spfile);
crfile[strlen(curfile) - 1] = '\0';
fclose(spfile);
/* MAIN (continued) */
/* ----------------------------------------------------------*/
/* assign prfile name of print file */
/* open up print file */
/* ----------------------------------------------------------*/
strcpy(prfile,crfile);
prfile[0] = 'd';
if ((pr=open(prfile,O_RDONLY,NULL)) == BAD){
fprintf(log,"%s spool file open error\n",curtime);
exit(0);
}
/* ----------------------------------------------------------*/
/* Put job header information into completion log file */
/* ----------------------------------------------------------*/
fprintf(log,"--------------------------------------------\n");
fprintf(log,"%s *** User - %s *** \n",curtime,username);
/* ----------------------------------------------------------*/
/* The next section will attempt to output the print file */
/* to the printer. After each buffer is written we go to */
/* check printerport to see if the QMS has sent us any */
/* status or error messages */
/* If we have recieved a message from the Qms then we go */
/* handle it. */
/* If we output the entire file successfully then send an */
/* EOT character. */
/* Now we give the printer one last chance to send us info */
/* If it does not then we consider the print successful */
/* ----------------------------------------------------------*/
while (retry <= 1){ /* Will try even flush job twice */
while ((siz = read(pr,buf,NBYTES)) > 0){ /* read till EOF */
write(alfp,buf,siz); /* write to printer
*/
if (errlin = getlperr(alfp,READ_POLL)){ /* check print port
*/
pos = prep_retry(pr,&retry,errlin); /* handle error */
break; /* exit while loop */
}
} /* end while NOT EOF */
write(alfp,&et,1); /* send EOT */
if (!errlin){ /* Last chance */
if (errlin = getlperr(alfp,READ_WAIT)){ /* check print port
*/
pos = prep_retry(pr,&retry,errlin); /* handle error */
}else{
fprintf(log,"Printed ok\n"); /* ok dokey > LOGFILE
*/
retry = 256; /* ok dokey flag */
}
}
} /* end while retry */
/* ----------------------------------------------------------*/
/* close up and head home */
/* ----------------------------------------------------------*/
fclose(log);
close(alfp);
close(pr);
} /* end main */
/* PREP_RETRY */
/* -------------------------------------------------------------*/
/* Based on the error we got from the Qms take appropriate action */
/* Rewind print file for retry */
/* -------------------------------------------------------------*/
prep_retry(fp,numtry,errtyp)
int fp; /* file we are trying to print */
int *numtry; /* number of tries to print */
int errtyp; /* what error did I get from QMS */
{
int byt;
switch (errtyp){
case PRINTERR: /* will retry until printer is ok */
sleep(60);
break;
case FLUSHERR: /* will only try a flushed file twice */
sleep(10);
*numtry += 1;
break;
/* default - all errors are not fatal but we
*/
default: /* treat as fatal- change as we learn about
printer*/
sleep(10); /* will only try these errors twice */
*numtry += 1;
break;
} /* end switch */
byt = lseek(fp,0,L_SET); /* rewind file to beginning for retry */
return(byt); /* return file pointer is */
}
/* GETLPERR */
/* -------------------------------------------------------------*/
/* This routine will get any messages that the Qms sends to us */
/* We wait for a message the time specified by the caller in delay */
/* This routine returns the error type of message received */
/* -------------------------------------------------------------*/
getlperr(fp,delay)
int fp; /* printer port */
int delay; /* how long to wait for response */
{
char bffer[NBYTES], *buffer = &bffer[0]; /* input buffer */
int first_loop; /* flag to know that we were just called */
int i;
int err; /* error type - returned */
intlen; /* length of read buffer */
/* -------------------------------------------------------------*/
/* see select(2) for a description of next int line */
/* -------------------------------------------------------------*/
int result, numdes = 32, readdes = 0, writedes = 0, exceptdes = 0;
struct timeval timeout; /* wait how long for response from qms
*/
timeout.tv_sec = delay; /* caller tells us how long to wait */
timeout.tv_usec = 0; /* caller tells us on first loop only */
first_loop = 1;
err = 0; /* init error to none */
readdes = 1 << fp; /* set up select mask - see select(2) */
/* -------------------------------------------------------------*/
/* select will return "true" for the following while if the */
/* port attached to the printer has something in it's buffer */
/* for us to read. select will wait "timeout long" for input to
port */
/* -------------------------------------------------------------*/
while (result =
select(numdes,&readdes,&writedes,&exceptdes,&timeout)){
if (first_loop){ /* The time to wait for first read is
given by */
first_loop--; /* caller, but all read timeouts after
that */
timeout.tv_sec = 5; /* will be 5 seconds */
}
if ((len = read(fp,buffer,NBYTES)) > 2){ /* read a record
from port */
buffer[len - 1] = '\0';
/* -------------------------------------------------------------*/
/* Determine error type , set up return value */
/* -------------------------------------------------------------*/
if (!strncmp(buffer,PERRMSG,strlen(PERRMSG)))
err = PRINTERR;
else
if (!strncmp(buffer,FERRMSG,strlen(FERRMSG)))
err = FLUSHERR;
else
err = OTHERERR;
fprintf(log,"%s\n", buffer); /* error to LOGFILE */
}
}
return(err);
}
----------
X-Sun-Data-Type: h-file
X-Sun-Data-Name: qms_ttyXX.h
X-Sun-Content-Lines: 27
X-Sun-Content-Length: 796
/* This include file defines the log file for job status and */
/* the tty port on the vax which the printer is connected to */
/* To set up a new printer */
/*
- cp qms_ttyXX.c qms_tty??.c
- cp qms_ttyXX.h qms_tty??.h
- Modify qms_tty??.c - change first include to point at new .h file
- Modify qms_tty??.h - change server tty port or logfile
- cc -o qms_tty?? qms_tty??.c ( creates executable filter )
- chmod 4755 qms_tty?? ( gives filter privs )
- be sure spool directory is chmod 777
*/
#define LOGFILE "qms.log" /* Modify this for name of log status
file */
/* Log file resides in spool dir from
printcap */
#define DEV "/dev/ttyXX" /* Modify this for server tty port */
/* printer is hooked to */
----------
X-Sun-Data-Type: h-file
X-Sun-Data-Name: qmsfilt.h
X-Sun-Content-Lines: 28
X-Sun-Content-Length: 688
/* Include file for Qms printers */
#include
#include
#include
#include
#include
#include
#include
#define EOT 4 /* send at end of transmission to printer
*/
#define TRUE 1
#define FALSE 0
#define BAD -1
#define NBYTES 512 /* max size of buffer to read from file */
#define READ_WAIT 30 /* time to wait for Qms response (seconds)
*/
#define READ_POLL 0 /* same as above */
#define PERRMSG "%%[ PrinterError:" /* Messages from QMS */
#define FERRMSG "%%[ Flushing:"
#define PRINTERR 100 /* Error types */
#define FLUSHERR 200
#define OTHERERR 300
93) *OKIDATA MICROLINE 391 - RS232SERIAL PORT (/dev/ttya) ----------------
/etc/printcap:
==============
# Basic Control for Okidata -- modify as needed
lp|oki24|oki|okidata midroline391: :br#9600:lp=/dev/ttya: :sd=/usr/spool:tr=\f:
System settings:
================
PRINTER oki
lp oki
stty 9600
Cable:
======
Pins 2&3 reversed
Okidata Printer settings:
=========================
Font Print Mode Utility
General Control Emulation Mode Epson LQ
Vertical Control Line Spacing 6 LPI
Symbol Sets Character Set Set I
Serial I/F Option Parity None
Serial I/F Option Serial Data 7 or 8 Bits 8
Serial I/F Option Protocol X-ON/X-OFF
Serial I/F Option Diagnostic Test No
Serial I/F Option Busy Line RTS
Serial I/F Option Baud Rate 9600 BPS
Serial I/F Option DSR Signal Invalid
Serial I/F Option DTR Signal Ready on Select
Serial I/F Option Busy Time 200
Milliseconds
lp2:okidata: :lp=/dev/ttya:sd=/var/spool/oki:br#1200: :ms=-parenb,ixon,opost,-onlcr:
94) P1000 PLOTTER -LOCAL ------------------------------------------------
# Local P1000 Plotter
#
CPM@|PPLT|p1000|P1000 Plotter: :lp=/dev/tty@:sd=/usr/spool/p1000d: :lf=/usr/spool/p1000d/log: :gf=/usr/lib/p1000f: :vf=/usr/lib/p1000f:sh:sf:br#9600:
95) P1000 PLOTTER -REMOTE -----------------------------------------------
# Remote P1000 Plotter
#
CPM@|PPLT|P1000 Plotter: :lp=:rm=CPM@host:rp=CPM@:sd=/usr/spool/p1000d: :lf=/usr/spool/p1000d/log:
96) *PACIFIC DATA PRODUCTS PRO TRACER ------------------------------------
ProTracer Installation Instructions for Sun
These are instructions for configuring lpr on a Sun machine
for printing serially to aPro-Tracer. To the Sun system, ProTracer
looks just like any other printer. This document gives an overall
view on installation.
These instructions work on both Sun's and Sparc machines runningSunOS 4.I.x. The same concepts apply to other UNIX
machines. For IBM, Epson, and Postscript, ProTracer uses the
Xon/Xoff protocol. HPGL can use either Xon/Xoff or RTS/CTS. For
clarification; Xon/Xoff is also called software flow control, and
RTS/CTS is called hardware flow control.
These instructions make the following assumptions:
* ProTracer is connected to /dev/ttya.
* The serial interface is configured for 9600 baud, 8 bits, no
parity.
* The installer has root access.
I. Make sure your serial cable is wired like this:
Sun Pro-Tracer
I I
2 3
3 2
7 4
5 5 <-- Only if RTS/CTS is used.
2. For HPGL you must have input filters. Compile the following 2
programs and move them to the appropriate directory,
typically /usr/local/bin. Be aware that when in HPGL mode
ProTracer does no flow control by default so one of these
filters must be used.
/*
* Use Xon/Xoff protocol.
* cc -o /usr/local/bin/xon xon.c
*/
#include
#define ESC Oxlb
main()
{
char c;
printf("%c.J%c.@:%cI356;;17:%c.N;19:%c.M:", ESC, ESC, ESC,
ESC, ESC);
while((c = getchar()) != EOF)
putchar(c);
exit(O);
}
------------ OR -------------
/*
* Use RTS/CTS handshaking.
*
* cc -o /usr/local/bin/rts rts.c
*/
#include
#define ESC Oxlb
main()
{
char c;
printf("%c.J%c.@;1:%c.I:%c.N:", ESC, ESC, ESC, ESC);
while((c = getchar())!= EOF)
putchar(c);
exit(O);
}
3. Add the following entries to /etc/printcap, as needed:
ProTracer|ProTracer_Xon| ProTracer, 96OO baud, Xon/Xoff flow
control: :lp=/dev/ttya:br#96OO:lf=/usr/adm/lpd-errs:sh:rw: :ms=litout:
ProTracer_RTS| ProTracer, 96OO baud, RTS/CTS flow control: :lp=/dev/ttya:br#96OO:lf=/usr/adm/lpd-errs:sh: :ms=litout,-clocal,crtscts:
ProTracer_HPGL_Xon|PTHX| ProTracer, HPGL, Xon/Xoff
protocol: :if=/home/jimh/hpgl/test/printcap/xon: :lp=/dev/ttya:br#96OO:lf=/usr/adm/lpd-errs:sh:rw: :ms=litout:
ProTracer_HPGL_RTS|PTHR| ProTracer, HPGL, RTS/CTS
protocol: :if=/home/jimh/hpgl/test/printcap/cts: :lp=/dev/ttya:br#96OO:lf=/usr/adm/lpd-errs:sh: :ms=litout,-clocal,crtscts:
4. To print an HPGL file using RTS/CTS flow control you can now
use the command:
lpr -PPTHR filename
5. It is possible that the ms line of a printcap file doesn't work
with SunOS's below 4.1. It is therefore suggested to use
on/Xoff flow control because it is the Sun default.
97) PLOTTERS AND SPARCSTATION 1's
I sent the following printcap to a customer that was having problems with
an Inter plotter and a Bruning plotter onthe SS1:
inter: :lp=/dev/ttya:sd=/var/spool/inter:br#9600:rm=intcad:rp=inter: :fs#06021:fc#0777:sb:sh:sf:xc#07737:xs#040:
This printcap took care of his problems and he said it is working fine.
98) PRINT-A-COLOR COLOR PRINTERS ---------------------------------------
Try these, no guarantees.
# Print-A-Color color printer
#
pac: :lp=/dev/pac:sd=/usr/spool/lppacd:sh:xs#040:
paclp: :lp=/dev/pac:sd=/usr/spool/lppaclpd:sh:xc#040:
99) PRINTRONIX P600 PARALLELPRINTER ------------------------------------
lp|printer|Printronix Parallel Printer: :lp=/dev/mcpp0:sd=/var/spool/lpd: :fo:mx#0:of=/usr/lib/lpf:lf=/usr/adm/lpd-errs:
100) PRINTRONIX TEXT ONLY ------------------------------------------------
#
# printronix text only
0|lp|pp|printronix: :sd=/usr/spool/lpd:lf=/usr2/util/.printer.log: :br#9600:fc#0177777:fs#0006000:lp=/dev/tty0a:xc#0177777:xs#000040:
101) PRINTRONIX W/TAB SUPPORT -------------------------------------------
#
# printronix with tab support
5|lpt|pr-tab|printronix: sd=/usr/spool/lpt:lf=/usr2/util/.printer.log: br#9600:fc#0177777:fs#0006000:lp=/dev/tty0a:xc#0177777:xs#000000:
102) PRINTRONIX WITH ELECTRONIC VERTICAL FORMSCONTROL -----------------
#
# printronix with electronic vertical forms control
8|lp8|pp8|printronix-w-evfu: :sd=/usr/spool/lpd:sh:sf:lf=/usr2/util/.printer.log: :br#9600:fc#0177777:fs#0000060:lp=/dev/tty0a:xc#0177777:xs#000000:
103) *QMS 810 (VERY LONG LISTING)-----------------------------------------
NOTE: THE FOLLOWING CONTAINS FOUR FILES:
QMS810 PRINTCAP
QMS TTYXX.C
QMS TTYXX.H
QMS FILTER
charlie: :ts=X00860B: :op=PORT_1: :br#9600: :fc#0177456: :fs#0000321: :lf=/usr/adm/lat1err: :sd=/nfs/spool/charlie: :lp=/dev/tty08: :if=/nfs/lpdfilters/qms_tty08: :rw=true: :sf: :sh: :mx#0: :xc#077737: :xs#000040:
#
#------------------------------------------------------
#
/******************************************************************/
/* IMPORTANT ***************SEE qms_ttyXX.h **********************/
/* The following include MUST be changed to point at the correct */
/* include file for this printer */
#include "qms_ttyXX.h" /* Modify for correct tty port */
/* SEE qms_ttyXX.h FOR MORE DETAILS *******************************/
/******************************************************************/
/* Filter for Qms printers */
/* The Qms printers return error messages if there is */
/* something wrong with the printer or the file to be printed */
/* This filter will analyze the errors and attempt to print job */
/* successfully */
/* If a job was flushed we will attempt to print again because */
/* a garbled byte from a communication failure to the printer may */
/* have caused problem. If the job flushes twice we assume we */
/* got a bad postscript file and exit */
/* If a job could not be printed because the printer failed */
/* ie... out of paper etc ... then we will keep trying to printjob */
/* until printer error is resolved */
#include "qmsfilt.h" /* All includes and defines */
FILE *log; /* Completion status log file */
main(argc, argv)
char *argv[];
{
char *curtime; /* bufferfor time stamp */
char crfile[80],*curfile = &crfile[0]; /* print command file */
char prfile[80],*purfile = &prfile[0]; /* print file */
char *username; /* print job sender */
char *host; /* job host */
char *cp; /* general pointer */
char *acctfile; /* accounting file */
int retry = 0; /* number of tries printing job */
int errlin = 0; /* Error returned from getlperr */
int pos;
char et = EOT; /* see defines */
char buff[NBYTES], *buf = &buff[0]; /* read buffer */
int job_name = 0; /* Non zero after job name found */
int user_name = 0; /* Non zero after job sender found */
FILE *spfile;
long tlong;
int getlperr();
int i;
int siz = 0; /* bytes read */
int pr; /* print file descriptor */
int alfp; /* device file descriptor */
extern int errno;
/* MAIN */
/*------------------------------------------------------*/
/* get args from lpd */
/*------------------------------------------------------*/
while (--argc){
if (*(cp = *++argv) == '-'){
switch (cp[1]){
case 'n': /* username of sender */
argc--;
username = *++argv;
break;
case 'h': /* hostname */
argc--;
host = *++argv;
break;
default: /* ignore rest */
break;
}
}else{
acctfile= cp; /* accountinf file */
}
}
/* ----------------------------------------------------------*/
/* get current time for completion log */
/* ----------------------------------------------------------*/
time(&tlong);
curtime = ctime(&tlong);
curtime += 4; /* point to Month */
*(curtime + 16) = '\0'; /* end after time */
/* ----------------------------------------------------------*/
/* open completion error log file */
/* if open fails printer will not work */
/* ----------------------------------------------------------*/
if ((log = fopen(LOGFILE,"a")) == NULL){
exit(0);
}
/* ----------------------------------------------------------*/
/* open device (tty) that printer is attached to */
/* ----------------------------------------------------------*/
if ((alfp=open(DEV,O_RDWR,NULL)) == BAD){
fprintf(log,"%s printer open error\n",curtime);
exit(0);
}
/* ----------------------------------------------------------*/
/* open lock file which contains name of print command file */
/* read name of file , store in curfile */
/* close lock file */
/* ----------------------------------------------------------*/
if ((spfile = fopen("lock","r")) == NULL){
exit(0);
}
curfile = fgets(curfile, 512, spfile);
curfile = fgets(curfile, 512, spfile);
crfile[strlen(curfile) - 1] = '\0';
fclose(spfile);
/* MAIN (continued) */
/* ----------------------------------------------------------*/
/* assign prfile name of print file */
/* open up print file */
/* ----------------------------------------------------------*/
strcpy(prfile,crfile);
prfile[0] = 'd';
if ((pr=open(prfile,O_RDONLY,NULL)) == BAD){
fprintf(log,"%s spool file open error\n",curtime);
exit(0);
}
/* ----------------------------------------------------------*/
/* Put job header information into completion log file */
/* ----------------------------------------------------------*/
fprintf(log,"--------------------------------------------\n");
fprintf(log,"%s *** User - %s *** \n",curtime,username);
/* ----------------------------------------------------------*/
/* The next section will attempt to output the print file */
/* to the printer. After each buffer is written we go to */
/* check printer port to see if the QMS has sent us any */
/* status or error messages */
/* If we have recieved a message from the Qms then we go */
/* handle it. */
/* If we output the entire file successfully then send an */
/* EOT character. */
/* Now we give the printer one last chance to send us info */
/* If it does not then we consider the print successful */
/* ----------------------------------------------------------*/
while (retry <= 1){ /* Will try even flush job twice */
while ((siz = read(pr,buf,NBYTES)) > 0){ /* read till EOF */
write(alfp,buf,siz); /* write to printer */
if (errlin = getlperr(alfp,READ_POLL)){ /* check print port */
pos = prep_retry(pr,&retry,errlin); /* handle error */
break; /* exit while loop */
}
} /* end while NOT EOF */
write(alfp,&et,1); /* send EOT */
if (!errlin){ /* Last chance */
if (errlin = getlperr(alfp,READ_WAIT)){ /* check print port */
pos = prep_retry(pr,&retry,errlin); /* handle error */
}else{
fprintf(log,"Printed ok\n"); /* ok dokey > LOGFILE */
retry = 256; /* ok dokey flag */
}
}
} /* end while retry */
/* ----------------------------------------------------------*/
/* close up and head home */
/* ----------------------------------------------------------*/
fclose(log);
close(alfp);
close(pr);
} /* end main */
/* PREP_RETRY */
/* -------------------------------------------------------------*/
/* Based on the error we got from the Qms take appropriate action */
/* Rewind print file for retry */
/* -------------------------------------------------------------*/
prep_retry(fp,numtry,errtyp)
int fp; /* file we are trying to print */
int *numtry; /* number of tries to print */
int errtyp; /* what error did I get from QMS */
{
int byt;
switch (errtyp){
case PRINTERR: /* will retry until printer is ok */
sleep(60);
break;
case FLUSHERR: /* will only try a flushed file twice */
sleep(10);
*numtry += 1;
break;
/* default - all errors are not fatal but we */
default: /* treat as fatal- change as we learn about printer*/
sleep(10); /* will only try these errors twice */
*numtry += 1;
break;
} /* end switch */
byt= lseek(fp,0,L_SET); /* rewind file to beginning for retry */
return(byt); /* return file pointer is */
}
/* GETLPERR */
/* -------------------------------------------------------------*/
/* This routine will get any messages that the Qms sends to us */
/* We wait for a message the time specified by the caller in delay */
/* This routine returns the error type of message received */
/* -------------------------------------------------------------*/
getlperr(fp,delay)
int fp; /* printer port */
int delay; /* how long to wait for response */
{
char bffer[NBYTES], *buffer = &bffer[0]; /* input buffer */
int first_loop; /* flag to know that we were just called */
int i;
int err; /* error type - returned */
int len; /* length of read buffer */
/* -------------------------------------------------------------*/
/* see select(2) for a description of next int line */
/* -------------------------------------------------------------*/
int result, numdes = 32, readdes = 0, writedes = 0, exceptdes = 0;
struct timeval timeout; /* wait how long for response from qms */
timeout.tv_sec = delay; /* caller tells us how long to wait */
timeout.tv_usec = 0; /* caller tells us on first loop only */
first_loop = 1;
err = 0; /* init error to none */
readdes = 1 << fp; /* set up select mask - see select(2) */
/* -------------------------------------------------------------*/
/* select will return "true" for the following while if the */
/* port attached to the printer has something in it's buffer */
/* for us to read. select will wait "timeout long" for input to port */
/* -------------------------------------------------------------*/
while (result = select(numdes,&readdes,&writedes,&exceptdes,&timeout)){
if (first_loop){ /* The time to wait for first read is given by */
first_loop--; /* caller, but all read timeouts after that */
timeout.tv_sec = 5; /* will be 5 seconds */
}
if ((len = read(fp,buffer,NBYTES)) > 2){ /* read a record from port */
buffer[len - 1] = '\0';
/* -------------------------------------------------------------*/
/* Determine error type , set up return value */
/* -------------------------------------------------------------*/
if (!strncmp(buffer,PERRMSG,strlen(PERRMSG)))
err = PRINTERR;
else
if (!strncmp(buffer,FERRMSG,strlen(FERRMSG)))
err = FLUSHERR;
else
err = OTHERERR;
fprintf(log,"%s\n", buffer); /* error to LOGFILE */
}
}
return(err);
}
---------------------------------------
/* This include file defines the log file for job status and */
/* the tty port on the vax which the printer is connected to */
/* To set up a new printer */
/*
- cp qms_ttyXX.c qms_tty??.c
- cp qms_ttyXX.h qms_tty??.h
- Modify qms_tty??.c - change first include to point at new .h file
- Modify qms_tty??.h - change server tty port or logfile
- cc -o qms_tty?? qms_tty??.c ( creates executable filter )
- chmod 4755 qms_tty?? ( gives filter privs )
- be sure spool directory is chmod 777
*/
#define LOGFILE "qms.log" /* Modify this for name of log status file */
/* Log file resides in spool dir from printcap */
#define DEV "/dev/ttyXX" /* Modify this for server tty port */
/* printer is hooked to */
---------------------------------------
/* Include file for Qms printers */
#include
#include
#include
#include
#include
#include
#include
#define EOT 4 /* send at end of transmission to printer */
#define TRUE 1
#define FALSE 0
#define BAD -1
#define NBYTES 512 /* max size of buffer to read from file */
#define READ_WAIT 30 /* time to wait for Qms response (seconds) */
#define READ_POLL 0 /* same as above */
#define PERRMSG "%%[ PrinterError:" /* Messages from QMS */
#define FERRMSG "%%[ Flushing:"
#define PRINTERR 100 /* Error types */
#define FLUSHERR 200
#define OTHERERR 300
104) *QMS ESP Printers - SunOS 4.1 or greater -----------------------------
# the purpose for creating two queues is to enable rapid switching between
# emulations... ie: Hppcl and PostScript
# This printcap entry is used to set ttya to 19200 baud, no parity,
# 8 data bits and one stop bit.
#
QmsPs815: :lp=/dev/ttya: :sd=/usr/spool/QmsPs815: :lf=/usr/spool/QmsPs815/log: :mx#0: :br#19200: :ms=-parenb,cs8,-istrip,onclr,-cstopb: :sh:sb:rw:sf:
# This printcap entry is used to redirect standard input to the filter Ps815.
#
Ps815: :lp=/dev/ttya: :sd=/usr/spool/Ps815: :lf=/usr/spool/Ps815/log: :mx=#0: :if=/usr/bin/Ps815filter: :sh:sb:rw:
# This is the Ps815 filter which cats standard input and the Escape Sequence
# together. Create the files "Ps815filter" and "EscapeSeq" and chmod to 777.
----------- start of file Ps815filter -------------------
#!/bin/sh
PATH=/bin:/usr/bin:/usr/ucb:/etc
export PATH
cat - /usr/bin/EscapeSeq | lpr -PQmsPs815
--------------- end --------------------------------------
# Escape sequence file that resets the printer into the Esp mode after
# each print job.
------------- begin EscapeSeq -----------------------------
^[^?0
statusdict begin
0 200 setemulation
^D
--------------- end ---------------------------------------
105) SEIKO COLOR THERMAL TRANSFER PLOTTER -LOCAL --------------------------
# Local Seiko Color Thermal Transfer Plotter
#
SEK@|CHCP|COLOR|color|Seiko Color Thermal Plotter: :lp=/dev/vp0:sd=/usr/spool/sek53d:sh:sf:mx#0: :px#2048: :py#3072: :vf=/usr/lib/sek53f:lf=/usr/spool/sek53d/log:
106) SEIKO COLOR THERMAL TRANSFER PLOTTER -REMOTE -------------------------
# Remote Seiko Color Thermal Transfer Plotter
#
SEK@|CHCP|COLOR|color|Seiko Color Thermal Plotter: :lp=:rm=SEK@host:rp=SEK@:sd=/usr/spool/sek53d:sh:sf:mx#0 :lf=/usr/spool/sek53d/log:
107) TEKTRONIX PLOTTER ----------------------------------------------------
#
# Tektronixs plotter
4|lp4|plotter: :sd=/usr/spool/plotter:sh:sf:lf=/usr2/util/.printer.log: :br#9600:fc#0177777:fs#0000001:lp=/dev/tty09:xc#0177777:xs#040000:
108) TI 810 -------------------------------------------------------------
7|lp7|ti-810: :sd=/usr/spool/ti-810:lf=/usr/adam/printer.log: :br#4800:fc#0177777:fs#0006000:lp=/dev/tty0f:xc#0177777:xs#000000:
109) TI LASER PRINTER -LOCAL --------------------------------------------
# Local postscript printer driven by Transcript software
# Thisentry used by TI laser printer
#
lw@|ps|postscript|Postscript: :lp=/dev/lw:sd=/usr/spool/lw: :lf=/usr/spool/lw/lw-log:af=/usr/adm/lw.acct: :br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:mx#0:sf:sb: :if=/usr/local/lib/lw/psif: :of=/usr/local/lib/lw/psof:gf=/usr/local/lib/lw/psgf: :nf=/usr/local/lib/lw/psnf:tf=/usr/local/lib/lw/pstf: :rf=/usr/local/lib/lw/psrf:vf=/usr/local/lib/lw/psvf: :cf=/usr/local/lib/lw/pscf:df=/usr/local/lib/lw/psdf:
110) TOSHIBA LBP1080 LASER PRINTER -LOCAL -------------------------------
# Local Toshiba LBP1080 Laser Printer 9600bps 8-bit no-parity
#
:of=/usr/lib/vpf:if=/usr/lib/vpf:tf=/usr/lib/rvcat: :cf=/usr/lib/vdmp:vf=/usr/lib/vpltdmp:lf=/usr/spool/lpd-errs:
119) VERSATEC COLOR THERMAL TRANSFER PLOTTER -REMOTE --------------------
# Remote Versatec Color Thermal Transfer Plotter
#
VTP@|CHCP|COLOR|color|Versatec Color Thermal Plotter: :lp=:rm=VTP@host:rp=VTP@:sd=/usr/spool/vtp27d:sh:sf:mx#0 :lf=/usr/spool/vtp27d/log:
120) VERSATEC COLOR THRMAL TRANSFER PLOTTER -----------------------------
# Local Versatec Color Thermal Transfer Plotter
#
VTP@|CHCP|COLOR|color|Versatec Color Thermal Plotter: :lp=/dev/vp0:sd=/usr/spool/vtp27d:sh:sf:mx#0: :px#2048: :py#3072: :vf=/usr/lib/vtp27f:lf=/usr/spool/vtp27d/log:
121) VERSATEC HARDCOPY DOT-MATRIX PLOTTER -LOCAL -------------------------
# Versatec hardcopy dot-matrixplotter (local)
#
VST@|DTMX|versatec|Versatec: :lp=/dev/vp0:sd=/usr/spool/hardcopyd: :lf=/usr/spool/hardcopyd/log:
122) VERSATEC HARDCOPY DOT-MATRIX PLOTTER -REMOTE ------------------------
# Versatec hardcopydot-matrix plotter (remote)
#
VST@|DTMX|versatec|Versatec: :lp=:rm=versatechost:rp=versatec: :sd=/usr/spool/hardcopyd: :lf=/usr/spool/hardcopyd/log:
=============================[END PRINTCAPS]===============================
=====================[TUTORIALS/CHARTS/DIAGRAMS]============================
1) GENERIC PRINTCAP TUTORIAL -------------------------------------------
>From davidj@sunscot.UK.Sun.COM
#
# @(#)printcap.templates 1.5 88/04/20 CV
#
#
# This is a template of printer printcap entries used to create
# new entries in the /etc/printcap file
#
# The template is constructed in a fairly rigid manner. Each printer or
# plotter must have a local and a remote entry. The local entry must
# be first. The line specifying the names of the printer/plotter
# must specify three and only three names. Their definition is as follows:
#
# Field 1 : Unique printer/plotter name. For CADDS devices this
# MUST be 4 characters long, the first three of whichare:
# EPS@ - Epson Dot Matrix Printer
# (seperate entries for FX-185 and VP-130K)
# SEK@ - Seiko Thermal Color Plotter
# VTP@ - Versatec Thermal Color Plotter
# VST@ - Versatec Dot Matrix
# VR6@ - Benson Dot Matrix
# CPM@ - P1000 pen plotter
# HP7@ - Hewlett Packard 7580 pen plotter
# C96@ - Calcomp pen plotters
# BNS@ - Benson pen plotters
# TLC@ - Toshiba Laser Printer
# TPT@ - Toshiba Dot Matrix Printer
# Field 2 : Generic device type. For CADDS devices this MUST be
# 4 characters long and corresponds to the "generic"
# name quailifier used by CADDS. The defined generic types are:
# DTMX - Dot Matrix Plotters
# PPLT - Pen Plotters
# HDCP - Monochrome Hard Copy
# CHCP - Color Hard Copy
# Field 3 : Full printer/plotter device name.
#
# Unique names are generated from the template by appending a unique number n
# (n beginning at 0) for the character "@".
#
# For the local entry, the only other variable input location (marked with the
# "@") is the device specification. It is used to define at which physical I/O
# port the device is connected.
#
# The remote entry must specify a remote machine (rm) and a remote printer
# (rp). The rp entry must be absolutely identical to the first printer name.
# This is the name with the unique number suffix.
# The rm entry must be the same as the first printer name with "host" as a
# suffix. These two fields are the only other fields with variable input.
# In all other ways the /etc/printcap template file must adhere to the
# standards required for the /etc/printcap file.
#
#
2) CALCOMP 1023 PLOTTER TUTORIAL (long) ----------------------------------
I have gotten the Calcomp 1023 plotter to work fine for a 1Mb plot file
using lpr on the ttya port with the serial port patch installed. This
plotter can emulate many different types of plotters and I have tried
a couple of different ones. Here is what I have tried and I will update
you as I try different combinations of things.
Test 1 (SUCCESSFUL)
------
Printcap entry:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0: :ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
Plotter settings:
Plotter type= 7585A
format= CPGL
baud rate= 9600
8 data bits, 1 stop bit
no parity
Test 2 (SUCCESSFUL)
------
Printcap entry:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0: :ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
Plotter settings:
Plotter type= CLCMP
format= CPGL
baud rate= 9600
8 databits, 1 stop bit
no parity
Test 3 (SUCCESSFUL)
------
Printcap entry:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0: :ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff,-echo:
Plotter settings:
Plotter type= CLCMP
format= CPGL
baud rate= 9600
7 data bits, 1 stop bit
even parity
Test 4 (FAILED): "data framing error....RESET" error on plotter
------
Printcap entry:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0: :ms=cs8,ixon,ixoff:
Plotter settings:
Plotter type= 7585A
format= CPGL
baud rate= 9600
8 data bits, 1 stop bit
no parity
The calcomp 1023 plotter is known as a non-roll feed plotter. This means
that sheets of paper must be changed between plot jobs. Sending
multiple plot jobs to the queue with lpr, causes plotter to starts the
next plot right after the last plot, on the same piece of paper!
To get around this problem send a halt request to the plotter
to put it offline in between plots so paper can be changed.
To do this a file called "nr" was created and its contents are as
follows:
NR;
Then send this file to the plotter with lpr in between plot jobs.
For instance:
lpr plot1
lpr nr
lpr plot2
lpr nr
lpr plot3
And so on, and so on. This NR; is the "not ready" HPGL command which the
calcomp recognizes in its version of HPGL called CPGL.
....
CALCOMP 104x PLOTTER
I did some testing with a Calcomp 1044 plotter(which is the roll-feed version
of the 1043) yesterday and was able to get a set of working settings for
the 386i. I was able to get a 1Mb plot file to go out to the plotter no
problem.
The plotter settings that I used were the following:
PCI mode
7 data bits
1 stop bit
even parity
xon/xoff= yes
direct control =yes or no
full duplex
sync code = 2
sync code value = 022
internal clock
term muting = no
chksum enable = yes
isochronous = no
The switch bank on the back of the plotter had switch 5 on and all the
rest off. This meant it was set to normal DTE.
Also, probably a grey area for most users out there: The plotter had the
most current ROM pack on it. This particular plotter can switch ROM packs
around. There is also a CPGL ROM pack (as opposed to the PCI ROM pack
that I had on the plotter) that emulates HPGL(Hewlett-Packard Graphics
Language) that some users maythink they have, but this is an additional
ROM pack that must be purchased. Anyways, a user cannot tell by looking
at the ROM pack whether they have the most current ROM pack or not. They
need to call their local Calcomp Field Service office and they can help
them with this issue.
The printcap entry used for the plotter was the following:
tim: :lp=/dev/ttya:sd=/var/spool/tim:br#9600:sf:sh:mx#0: :ms=cs7,parenb,-parodd,-ignpar,ixon,ixoff:
The plotter was not added thru SNAP!
Anyways, this is a tested configuration for the 104x Calcomp plotters and
the only thing that the customer might want to check if this doesn't work
is to find out what rev of the ROM on the plotter they are running.
3) SETTINGS FOR OPERATING OKIDATA MICROLINE 391 VIA RS232 SERIAL PORT
(/dev/ttya)--------------------------------------------------------
/etc/printcap:
==============
# Basic Control for Okidata -- modify as needed
lp|oki24|oki|okidata midroline391: :br#9600:lp=/dev/ttya: :sd=/usr/spool:tr=\f:
System settings:
================
PRINTER oki
lp oki
stty 9600
Cable:
======
Pins 2&3 reversed
Okidata Printer settings:
=========================
Font Print Mode Utility
General Control Emulation Mode Epson LQ
Vertical Control Line Spacing 6 LPI
Symbol Sets Character Set Set I
Serial I/F Option Parity None
Serial I/F Option Serial Data 7 or 8 Bits 8
Serial I/F Option Protocol X-ON/X-OFF
Serial I/F Option Diagnostic Test No
Serial I/F Option Busy Line RTS
Serial I/F Option Baud Rate 9600 BPS
Serial I/F Option DSR Signal Invalid
Serial I/F Option DTR Signal Ready on Select
Serial I/F Option Busy Time 200 Milliseconds
Make sure that the printcap and ypprintcap is the same file as this was
a known problem in4.0.0 for remote printing.
For a plotter with 9600 baud, 7 databits, 1 stop bit, even parity and
xon/xoff include the following in the printcap (common config for autocad):
:br#9600: \ #sets baud rate
:sh:sf: \ #suppresses header and footer
:xs#040000: \ #sends a cntl Q for DTR
:ms=-parityenb,-parityodd,-crtscts,-cstopb,cs7,ixon,-opost: #comm parameters
For a plotter with 9600 baud, 8 databits, 1 stop bit, no parity , and xon/xoff include the following in the printcap:
:br#9600: \ #sets baud rate
:sh:sf: \ #suppresses header and footer
:xs#040000: \ #sends a cntl Q for DTR
:ms=-parity,-crtscts,-cstopb,cs8,ixon,-opost: #comm parameters
Reference: man pages termio on ms options
Most plotters do not utilize pin 8 on the serial cable. The Owner's
Bulletin, pg. 16, says to put the following in rc.local:
/usr/etc/ttysoftcar -y /dev/tty
There is also a known problem with the serial port that was supposed to have
been fixed in 4.0.1. The serial port prematurely closes before it is
finished plotting. Tim is working on this problem with ecd. A temporary
fix is to run the following:
cat > /dev/tty$.
The $ should be replaced with a, m0, or m1 depending on the serial port being
used. This will dedicate a window but is temporary until a patch canbe made.
A note for those adding second serial ports:
The serial port that comes with the RR does not deal with interrupts that
DOS cares about. This port should be assigned to /dev/ttya at all times.
Using /dev/ttym0 the serial port should be assigned interrupt 4, and for
/dev/ttym1 should be assigned interrupt 3. Therefore, a total of three
serial ports can be added.
Another note for AutoCAD users:
There is a problem running a digitizer on a second serial port. Must use
digitizer on /dev/ttya and plotters on second serial port. Autodesk is
working on this problem.
....
58) HP 7475A PLOTTER
#
#
7|lp7|lw7|hp7580|hp7475|plotter|local A/D size HP pen plotter: :lp=/dev/ttya: :mx#0: :br#9600: :sd=/usr/spool/lwd7: :lf=/usr/spool/lwd7/log:
#(assuming the `A' model is not different)
PATCH ID: n/a
PRODUCT AREA: n/a
PRODUCT: prphl
SUNOS RELEASE: All
UNBUNDLED RELEASE: n/a
HARDWARE: Sun4
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Jeff Spiegel jeffs@lsil.com 408-433-4291 |
| LSI Logic Corp. G-813 FAX: 408-954-4874 |
| 1525 McCarthy Blvd. Milpitas, CA 95035 |
| |
| Jeff Spiegel Home #: 415-325-6905 |
| 2850 Middlefield Rd #232C |
| Palo Alto, CA 94306 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~