Line length problem with serial printer

Chris Jankowski chris at yarra.oz.au
Mon Aug 28 11:51:18 AEST 1989


In article <1066 at rex.cs.tulane.edu> mb at rex.cs.tulane.edu (Mark Benard) writes:
> I have just set up a Postscript printer on a tty port on a IOP/ITP on a 9815
> running OSx4.4+.  It works great with most filters that generate Postscript
> output, but I have one application that produces command lines with lengths
> that often exceed 132 characters.  The system seems to be either truncating
> the lines at 132 or inserting other characters that cause the printer to
> choke.
>
> I have put in a pw value of 255 in the printcap entry for that printer,
> but that does not help.  Should I be modifying the termcap entry for
> that tty port, or changing some port characteristic, to enable lines
> of length loner than 132 to pass through to the printer intact?
>
You need to do two things:
	1. Set pw capability in the printcap entry for the printer to 
sufficiently high value eg. pw#300.
	2. Do not use /usr/lib/lpf as a filter. (It is typicaly used as either
if or of filter).

Comment:
	The first is obvious. The second ie. real functioning of /usr/lib/lpf
is not documented very well if at all. I have only some observations which
are summarised below.
	It seems to me that /usr/lib/lpf is a hangover from the time of 
electric typewriter and drum and hammers lineprinter. It has the design
philosophy of a such a printer deeply ingrained in its workings.

	2. Standard accounting filter - /usr/ucb/lpf
	--------------------------------------------

	2.1. Indenting
	The filter does indenting. If the filter is not in a printcap
	entry of a printer (if=/usr/ucb/lpf) indenting option of lpr
	(-i option) will not work (unless you provide your own if
	filter doing that).

	2.2. Control characters filtering.
	By default the filter replaces control characters (other than
	BS, CR, LF and FF etc.) with spaces. This may be disabled 
	(ie. control characters are passed uninterpreted) by -l option
	of lpr.

	2.3. Maximum width of printouts.
	The filter limits maximum width to 132 characters. ie if you specify
	pw#150 you still get lines chopped to 132 characters.

	2.4. /usr/lib/necf filter - untried alternative.
	This filter may be better. It has been written with a dot matrix
	printer in mind peharps.

	2.5. Treatment of line terminating characters and line overlay
		optimisation.
	In general lpf treats CR character (^M) as true carriage return 
	ie. it assumes that characters following CR are to be printed 
	in the same line but starting from the beginning of the line
	(overprinting).
	LF character (^J) is treated as new line character ie. start
	printing from the beginning of the next line.

	All this seems reasonable but then comes optimisation done by
	lpf and it often produces unexpected results.
	The optimisation seems to be a hangover from the time of extremely
	slow electrical typewriters when the main concern was to minimise
	platten movements.

	This works like follows:
	1. If it finds CRLF or LFCR it filters out CR leaving only LF.
	There is no way I know about that you can switch off this filtering.
	If your printer needs both CR and LF you may try to have the following
	string as a line terminator: CRspaceLF. This should work in most
	cases.
	2. If there is a line of text terminated by a CR and another line
	after this the filter will swap all spaces in the first line and
	chararacters from the coresponding positions in the second line.

Those are just observations. I do not have access to the source code.

Hope this helps.

      -m-------   Chris Jankowski - Senior Systems Engineer chris at yarra.oz{.au}
    ---mmm-----   Pyramid  Technology  Australia	    fax  +61 3 820 0536
  -----mmmmm---   11th Floor, 14 Queens Road                tel. +61 3 820 0711
-------mmmmmmm-   Melbourne, Victoria, 3004       AUSTRALIA       (03) 820 0711

"Knowing how things work is the basis for appreciation,
and is thus a source of civilized delight."  -- William Safire



More information about the Comp.sys.pyramid mailing list