File: README

package info (click to toggle)
cti-ifhp 2.1.8-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 932 kB
  • ctags: 845
  • sloc: ansic: 6,036; sh: 1,524; makefile: 318
file content (312 lines) | stat: -rw-r--r-- 15,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
                    README for IFHP
                    ===================

                Patrick Powell <papowell@sdsu.edu>
                  Sun Oct 29 06:25:05 PST 1995

This code has been derived from the CTI Laser Jet filter set;
a modified version of the original README is attached below.
The distribution name and executables have been renamed in order
to ease problems with installation and management.

1. The following executables are available:
    ifhp,ofhp    - IF and OF filter
    banner.sh    - PCL banner printer (GNU AWK)
       - ofhp is symbolic link to or copy of the ifhp filter
       - if ifhp invoked as ofhp or with -Fo option, acts as OF filter
       - 'ofhp -Tbanner' will print banners using banner.sh

2. The if filter will check the job files for printability and/or
    postscript format.  If it is PostScript,  it will set the printer
	to PostScript mode using the PCL commands,  otherwise it will
	set the printer to PCL.  If you do not want this to happen,
	then print the job as a binary file;  this suppresses the checks.
	Some LPR spoolers use the 'v' format to indicate a binary file;
	If this is the case you will need to use the following printcap:

	printer:
		:of=/usr/local/lib/filters/ofhp:
		:if=/usr/local/lib/filters/ifhp:
		:vf=/usr/local/lib/filters/ifhp -c:

    If your LPD server does not allow options in the filter spec,
	use the following entry and the following shell script:
		:vf=/usr/local/lib/filters/vfhp.sy:
    vfhp.sh -
        #/bin/sh
        /usr/local/lib/filters/ifhp -c  $*

2. ifhp takes the full range of LPD filter options, and uses or
    or ignores them as applicable. The following command line options
    are used:
    -c    - cleartext - dump this directly to the printer, no fonts,
            no nothing done.  For those desperate people trying to
            find a way to print those obnoxious files
    -sstatusfile    - the name of a status file that is updated with
            'rolling status' - i.e. - the last few log messages.
    -nuser, -hhost, -Jjob  - used by ofhp for banner printing defaults
    -T[filteroptions,]* - filter options
       autodetect=(yes|no*) printer has autodetect to determine
                            job type, PCL or POSTSCRIPT
                            ** AUTODETECT environment variable overrides
       banner[=off]         when in OF mode generates a banner using information
							supplied on the 'sb' (short banner) line sent
							by the LPR server to the of filter.
							When banner is off,  the input is simply passed to
							the output device and no banner page generation
							is done.
       cartridge=[*yes|no]  postscript cartridge present.
                            If a postscript job detected and no cartridge
                            prints a message and discards job.
                            ** CARTRIDGE environment variable overrides
       debug=debuglevel     set the debug level
       dev=outdevice        /iodevice  - an io device, opened RW
                            host%port
                            host%port+orig_port
                         	- a TCP/IP stream connection
					     	to port on host from (optional) orig_port
       fontdir=fontname
                            default font directory
       model=(III|IIID|IIISi|IV*)  HP model (default IV)
                            ** MODEL environment variable overrides
       plp=[yes|no*]         return errorcodes compatible with PLP
                            default is LPRng errorcodes.
       resourcesave=(yes|no*)  keep track of fonts
                            from previous job, and do not download if
                            font was last downloaded.  WARNING: if
                            multiple spoolers use printer this will not
                            work.
                            ** RESOURCESAVE environment variable overrides
       retries=nn (0*)      retry connection or printing count; 0 is infinite
                            ** RETRIES environment variable overrides
       sleep=nn (30*)       sleep between retries; 0 is no sleep
                            ** SLEEPTIME environment variable overrides
       stty=sttycommands    a set of stty commands applied when the
                            iodevice is a serial line.
       status=(on|off)      get printer status/linenumber information
       trace=(on|off*)       dump output to a trace file
                            ** TRACE environment variable overrides
       wrap=(on|off*)        wrap long ouptput lines
                            ** WRAP environment variable overrides

        example: hpif '-Tdevice=/dev/ttya,stty=-echo pass8 39200'
            -T=model=IIISi,plp,cart=yes,banner=off

       Note: you may have multiple -T options.

  The -T dev and stty parameters are useful when using the filter with
  SUN LPR systems.  You may need need a shim filter, i.e. - small shellscript
  to set the values:

  Printcap: 
        psfilter:if=/usr/local/lib/filters/ofhp.sh

  ofhp.sh:
        #/bin/sh
        /usr/local/lib/filters/ofhp `-Tstty=-echo pass8 39200' $*

  See the man page for option details.

3. The ifhp filter has the ability to download fonts to the printer.
   The font depends on the host originating a job.  The mapping is
   controlled by the FONTDIR/host_fonts file, which has lines of the form:
      hostname       font
    e.g.:
      leon.cti.gr    FONTDIR/dec-greek/cp12.fnt
    See font/host_fonts.proto for details and examples.
    The -Tfontdir=directory can be used to set the FONTDIR value,
    which defaults to the FONTDIR variable in the Makefile.
    The default is /usr/local/lib/filters/font.

4.  Printer problems are reported using syslog(3)-
     syslog( LOG_WARNING|LOG_LPR, msg);  
    consult the syslogd(8) man page for details of logging.  The parameters
	to syslog have been bombproofed and strings are less 80 bytes long.

5. Accounting.

   The accounting procedures may appear rather strange to somebody who does
   not come from an Academic environment where avoiding printer accounting
   has long been a tradition.  The following methods are used.

   1. At the start of a job the page counter value is read from the
      printer.  Since this value is electromechanical,  it is VERY difficult
      to modify it through software :-)
      The value is printed to the accounting file using a line of the form:
       start -hhost -uuser -pcountervalue -Pprinter; see src/doaccnt.c
        for details.
   2. At the end of a job the counter is read again, and the usage calculted;
      the following line is written to the accounting file:
       end -bpages -hhost -uuser -pcountervalue -Pprinter
   3. In addition, if the ACCNTSH value is not NULL and the file exists,
        then the accounting shell script is invoked with a command line
        of the form
           ACCNT -bpages -hhost -uuser -pcountervalue -Pprinter [accntfile]
   This may appear to be overkill, but it is not.  Believe me, it is not.
   Read the README.ACCOUNTING for details.

6. The original CTI filter code has been used extensively.  See the
   Copyright file for a list of the copyrights.
   
   See README.COPYRIGHT

README from the CTI-Print 1.2 Distribution (Edited for consistency with
 current version of this software)

The PLP-lpd-filters provided in this package have been developed as part of the
CTI-Print project at the Division of Computing Facilities of the Computer 
Technology Institute (CTI), Patras, Greece. The main objective of the project 
was to develop a mechanism to serve any kind of printing requests (ascii, PCL 
and PostScript jobs) from different network/OS environments supporting 
configurable downloading of fonts (in the case of ascii jobs) depending on the 
source of the request (i.e. in order to print jobs containing Greek characters 
such as the ISO 8859/7, DEC Greek etc).

The PLP-lpd-filters v1.0 are filters for HP LaserJet printers of the III and 
4 series. They have been developed to work as part of the lpd platform 
implemented by the PLP software (Portable Line Printer Spooler, release 
3.4.12 - Patrick Powell, San Diego State University, papowell@sdsu.edu, 
1988 - Justin Mason, jmason@iona.ie, 1994). However some patches to PLP 
v3.4.12 are required so that additional info is passed to the filters as
arguments.

(1) Interface of PLP-lpd-filters with the PLP lpd daemon
--------------------------------------------------------
* The filters provide the interface  between the PLP-lpd daemon and the
  printer and are to be configured in the printcap file in order to be executed 
  by the lpd daemon every time a printing request is sent to the printer.
* There are two filters for each printer series; one for the banner page 
  printing and another for the main printing job. 
* The filters are assigned to the :bp: and :if: printcap capabilities and, when 
  executed, are passed as arguments from the lpd all the necessary info 
  required for their functionality.

* Accounting:
- For the III series printers.
  Printers of this series do not support bidirectional communication; therefore
  counting is attempted by the filters software and not by the printer itself
  as the III series printers cannot return any status. For simple ascii files
  it's easy to implement accounting by counting chars and lines but not for 
  PCL and PostScript files.

- For the 4 series printers: full accounting is provided for ascii, PCL and 
  PostScript printing jobs (as all models of series 4 support status readback 
  commands, which can report directly from the printer the pages actually 
  printed).

* Printing in duplex mode:
  The filters can satisfy direct duplex printing requests (as long as the 
  printer model supports that and the optional duplex unit is attached) for
  Ascii, PCL and PostScript files. This is achieved when invoking lpr by 
  passing the "duplex" argument with the -Z flag.

* Printing in landscape mode:
  This is achieved in the same way as in the
  duplex case when invoking lpr by passing the "landscape" argument with the
  -Z flag.

* Line wrapping:
  By setting an env variable in the configuration files  the filter can set
  the printer to print with line wrapping. 

* Font downloading for ascii files from a font pool:

- The font to be downloaded for ascii files is specified per remote host in a 
  configuration file. This provides the System Administrator with the 
  capability to configure the printer with special character fonts such as for 
  various national languages (Greek in the CTI's case).

- The filters of the :if: capability send a file to
  the printer. They check the file beforehand and decide if it is a simple
  ascii, a PCL or a PostScript file. In the first case it downloads the 
  appropriate font from the font pool mentioned above. 
  If the file to be printed is in PCL the filter switches the printer
  to PCL mode and then sends the file to be printed. For the Postscript case 
  the printer acts similarly except that, for series III, it first checks if 
  the PostScript language is configured to the printer.

- In the original CTI filters, fonts were not downloaded every time a job
  was submitted.  Unfortunately there are two drawbacks here.

  The first is that this cannot work if a printer is controlled by more than
  one printer servers. This is because each of the servers can remember the
  font which was downloaded by itself and not by the others. Unless an
  interaction among the servers takes place some of them might be fooled
  about the font actually downloaded last to the printer.

  The second issue is that the LaserJet Series 4 printers need to have the
  Resource Saving option enabled in order to be able to keep a downloaded
  font during personality changes.  This has turned out to be difficult
  to do.  Thus, fonts are downloaded each time we have a job.

(4) Support of specific HP printer models
-----------------------------------------
* For series III the filters work for all models III, IIID and IIISi with the
  restrictions mentioned above when mentioning the supported printer features.
  You must use -Tstatus=off with these printers as they do not support
  status operations.

* In series 4 for the printer job level control the PJL (Printer Job Language) 
  is fully utilised. Actually the principles described in Chapter 9, Programming
  Tips for Using PJL, of the Printer Job Language Technical Reference Manual
  (HP 5961-0603, First Edition - July 1993) have considerably been taken into
  account.

* code for HP5 printers has been added, and appears to work satisfactorily.

(5) Principles of Operation
  The filter will start by sending synchronization and initialization code
  to the printer. Unless suppressed by -Tstatus=off,  the filter will
  try to read the current status of the printer, and then get the current
  page count value unless suppressed by -Tpagecount=off or -Tstatus=off.
  After this, the filter forks a child process to handle error reports
  from the printer and then transfers the job to the printer.  After
  the job has been transferred,  the child process is terminated and
  the filter process tries to restablish synchronization with the
  printer and read the page counter.  It will then report the status
  of the printer and exit.

* The printer status response handling is based on the responses returned by 
  the HP4m+ printer. According to the PJL manual there is no variation. 
  (In practice there are minor variations of error message formats).

(6) Debugging
-------------
* The System Administrator can check the filters-printer configuration by
  Tracing the chars sent to the printer. This is requested by setting an env
  variable in one of the configuration files.

(****** also the -Tdebug=level option ******)

(7) Usage
   Experience at CTI
   ---------------------------
* The filters for series III have been installed and operating on printer
  models III, IIID and IIISi at C.T.I. (a total number of five printers) 
  serving Ascii, PostScript and PCL requests from Unix, VMS and Novell 
  environments through a PLP printer server running on a SunOS 4.1.3 platform. 
  The results have been quite satisfactory.
  Especially with the IIISi printer the printing is fast. It could be even
  faster but there is the limiting reason of having to accompany with nulls 
  the language switching command (for PCL or PostScript). While printer is 
  receiving the nulls the filter process should sleep to give the printer the
  chance to make the transition. A lot of hard effort had really to be made to
  discover why these nulls had to be sent and what is the optimum number for
  each printer type.

* The series 4 filters  are currently used to drive an HP 4M and an HP 4MPlus 
  network printers. There have not been reported any problems apart from some 
  kind of delay. It seems that the printer takes some time to respond to the 
  status requests and this probably is the real cause of the filter delay.

  Experience Elsewhere
  --------------------
* The filter appears to work well with HP products.  There are some other
  printers that do support PJL that it does not work well with.  However,
  if -Tstatus=off is used, it appears to work well.

(7) Related e-mail lists
------------------------
Send your comments or suggestions to distribution e-mail list:

        plp@iona.ie  - PLP/LPRng support