4xthe mini multi-tasking HTTP/1.1 web-server
|
---|
|
Configuring the UNIX print-spooler for a Smart Label Printer is quite easy to do (sample scripts are provided with the distribution). The examples below are all designed to provide the following behaviour:
Solaris 2.x: | /dev/cua/a | /dev/cua/b | /dev/cua/0 | etc |
---|---|---|---|---|
Linux (kernel < 2.2): | /dev/cua0 | /dev/cua1 | etc | |
Linux (kernel >= 2.2): | /dev/ttyS0 | /dev/ttyS1 | etc | |
DYNIX/ptx 2.0: | /dev/cua/0 | /dev/cua/1 | etc | |
SunOS 4.1.3: | /dev/cua0 | /dev/cua1 | etc | |
IRIX 5.3: | /dev/ttym1 | /dev/ttym2 | etc |
When configuring the print-spooler, there is no need to specify the serial-port baud-rate or other stty/termios settings. slap always hunts for the printers' current baud rate (and switches the printer to its' fastest workable baud rate); and always explicitly sets the stty/termios modes needed to communicate with the printer.
Edit this script, and change the label-size, thus:
MEDIA=label-typeThe available label-types are listed in the manpage.
You may also need to change the setting of BAUDMAP: see the comments in the script.
Save your changes in another file, such as install_dir/lib/queue-name.pi.
lpadmin -p queue-name -I simple -T vanilla \ -i install-dir/lib/queue-name.pi \ -o nobanner -v portwhere port is the name of the serial-port device to which the printer is attached, install-dir is the directory where slap was installed, and queue-name is the name of the printer.
NOTE: you do not need to specify the "-o stty=..." option.
There are esoteric facilities (custom alerts, printer-classes, etc) that can be specified with other options - see your system documentation, or the manpage for lpadmin.
When submitting print-jobs with lp, you can specify the font to use on the command line, eg:
lp -d sl1 -o font=thames-bold-italic-24 file1.txtThe available fonts are listed in the manpage.
Edit this script, and change the label-size, thus:
MEDIA=label-typeThe available label-types are listed in the manpage.
You may also need to change the setting of BAUDMAP: see the comments in the script.
Save your changes in another file, such as install_dir/lib/queue-name.pi.
lpadmin -p queue-name \ -i install-dir/lib/queue-name.pi \ -v portwhere port is the name of the serial-port device to which the printer is attached, install-dir is the directory where slap was installed, and queue-name is the name of the printer.
When submitting print-jobs with lp, you can specify the font to use on the command line, eg:
lp -d sl1 -o font=thames-bold-italic-24 file1.txtThe available fonts are listed in the manpage.
Note that the "out-of-labels" printer-status will be reported to the user by mail, rather than being made visible in the output of lpstat. The latter seems to be impossible under the SVR3 spooler.
Edit this script, and change the font selection and label-size, thus:
FONT=font-name ... MEDIA=label-typeThe available font-names and label-types are listed in the manpage.
You may also need to change the setting of BAUDMAP: see the comments in the script.
Save your changes in another file, such as install_dir/lib/queue-name.if.
queue-name:\ :lp=port:rw:\ :if=install-dir/lib/queue-name.if:\ :sf:sb:sh:sd=spool-directory:where port is the name of the serial-port device to which the printer is attached, install-dir is the directory where slap was installed, and queue-name is the name of the printer. Spool-directory is as described in your local lpd manpage.
NOTE: you should not need to specify any of the :br:fc:fs:xc:xs: options in the printcap entry.
A common "fix" for this shortcoming is to define several logical printers all pointing to the same physical device, but each defined with a different input filter.
There are several other "fixes" for this LPD design flaw, including using another print-spooler altogether (such as LPRng). See the newsgroups, mailing-lists, et al.
Depending on your version of "lpd", printer errors such as "not responding", "out of labels" or "label jammed" may be reported to the console, to the user's terminal or even via "syslog". You can direct these messages to a specific named file or device by adding an :lf=path: element to the printcap entry for the printer.
Newer releases of LPRng require some additional steps (thanks to Gregory Borzecki for these instructions):
LPRng has many more capabilities, thus a more specific method for integrating slap with LPRng would be worth doing.