Rechercher une page de manuel
slap
Langue: en
Version: 09feb2001 (mandriva - 01/05/08)
Section: 1 (Commandes utilisateur)
Sommaire
NAME
slap - print text labels on a Smart Label PrinterSYNOPSIS
slap [ -b maxbaud -c num -f font -l -m size -o port -p type -portrait -s -x num -version ] [files]DESCRIPTION
slap prints the specified text files on any Seiko Instruments' Smart Label Printer (R). It is needed because such printers are not ASCII devices - they can only natively print raster images and communicate with the computer via a proprietary protocol.If no files are specified, input is read from standard-input.
Text that would fall off the bottom of a label is printed on the next label. Text that would fall off the side of a label is silently discarded. A new label is started for each input file.
The Smart Label Printers allow a printed label to be "torn off" without having to feed an extra (blank) label first. slap deliberately avoids printing blank labels, even those caused by explicit formfeeds or linefeeds.
slap recognises and interprets the common "control" characters:
-
- carriage return
- the print position is moved to the left margin.
- linefeed
- the print position is moved down by the height of the current font, and is also moved to the left-hand margin. In this sense, slap interprets "linefeed" in the same way as most other UNIX programs: as a "newline".
- formfeed
- the current label (if not blank) is ejected and the print position is moved to the start of the next label.
- backspace
- the print position is moved back to where the last character was started, resulting in "overprinting". Some other programs expect to be able to generate emboldened or underlined text using this method. A backspace as the first character of a line has no effect.
- horizontal tab
- moves the print position to the next tab-stop. Tab-stops are set at every 8 spaces.
OPTIONS
- -b maxbaud
- specifies the maximum baud-rate for communication with the printer. This is only needed to avoid bugs in some serial-port drivers. See NOTES.
- -c num
- print num copies of each label. Default is 1.
- -f font
- display text using font. The default is "areal-10". slap comes with the following fonts as standard:
Typefaces Point-Sizes Variations
career, areal, 8, 10, 12, bold, italic, strait, thames 14, 18, 24 bold-italic - Career is a monospaced "typewriter" typeface. Areal is a Swiss-style sans-serif typeface. Strait is a thin version of areal. Thames is a classical serif font, similar to that used in newspapers and books.
- All the standard fonts use the ISO-8859-1 (ECMA-94 Latin-1) character-set.
- If font is not a filename, the directories listed in the SLAP_FONTPATH environment-variable are searched to locate a file with the name:
- typeface-variation-pointsize.type
- where type is the printer-type (see -p flag, below), and the other components are as given in the table above. Note that -variation is omitted for non-bold, non-italic fonts.
- -l
- emit warnings and error-messages in LaserWriter format (some print-spooling systems require this). Default is to emit undecorated messages.
- -m media-type
- tells slap what kind of labels are loaded in the printer, according to the following table:
Description Size media-type
Standard Address Labels 28 x 89 mm std Euro Address Labels 36 x 89 mm euro Diskette Labels 54 x 70 mm disk Shipping Labels 54 x 101 mm ship Small Labels 28 x 51 mm small Thin Labels 14 x 87 mm strip 35mm Slide Labels 38 x 11 mm slide Cassette Labels 9 x 71 mm cass Leitz-Folder Labels 36 x 190 mm leitz Large Labels 51 x 190 mm large - The default is "std".
- -o port
- Send output to port, which should be the pathname of the serial-device file to which the printer is connected. By default, slap assumes that it's standard-output is already connected to the appropriate serial-device file.
- -p printer-model
- specifies the type of printer.
Printer Model Short Name model
Smart Label Printer SLP slp Smart Label Printer Plus SLP Plus slp/plus Smart Label Printer EZ30 SLP EZ30 slp/ez30 Smart Label Printer Pro SLP Pro slp/pro Smart Label Printer 100 SLP 100 slp/100 Smart Label Printer 120 SLP 120 slp/120 Smart Label Printer 200 SLP 200 slp/200 Smart Label Printer 220 SLP 220 slp/220 Smart Label Printer 240 SLP 240 slp/240 auto-detect auto auto - The default is, of course, "auto".
- -portrait
- Print in portrait orientation. The default is landscape.
- -s
- Remove leading empty lines from the top of each printed label. The default is not to.
- -x num
- selects the baud-rate-mapping scheme num (see PLATFORM ISSUES). Default is no mapping.
- -version
- display program version information to standard-error. This option suppresses all other processing.
SIGNALS
slap catches hangup, interrupt, quit, and terminate signals so that the printer can be put into a quiescent state if slap is terminated by an outside agent (eg: the print-spooling subsystem).After tidying up, slap stops catching the offending signal and sends itself the same signal, which (this time) will terminate it, giving the impression that the first occurence of the signal was not caught. This behaviour is needed to keep some print-spooling systems happy.
WARNINGS
Are printed to the standard-error channel.-
cannot read input file: name cannot create temporary file printer empty: load labels platen open: close lid
ERRORS
Fatal errors detected by slap, and the usual corrective actions, fall into several categories. All error messages are printed to the standard-error channel.Media Faults
The corrective action for these is self-evident, but read the printer manual beforehand - pulling the label paper through the printer by hand could invalidate your warranty.-
label jammed in printer!
Printer Faults
These can usually be fixed by making sure that the printer is connected and actually switched on, or by resetting the printer with the power-switch.-
printer not responding to status requests printer not responding hardware fault communication error command-protocol error timeout waiting for printer to become ready timeout waiting for printer to become idle
Serial-Port Configuration Errors
Your System Administrator should be able to fix these. Check that your serial-ports are configured to operate according to the POSIX 1003.1 termios(3) specifications.-
cannot set baud-rate on serial-port: name cannot set read-timeout on serial-port: name cannot set tty modes on serial-port: name
Permission Errors
Caused by a lack of permission to use a particular serial-port device:-
cannot open serial-port: name cannot read from serial-port: name cannot write to serial-port: name
Physical I/O Faults
In some cases these can be corrected by verifying that the cabling to the printer is not damaged, and by resetting the printer with the power-switch.-
read error on file/port-name write error on file/port-name
Usage Errors
These mostly indicate command-line mistakes.-
usage: slap [-b## -c# -f* -l -m* -o* -p* -s -x# -version] [files] cannot locate font: name invalid printer-model: model invalid media-type: type invalid media-size for model printer: size invalid media-size for model printer: size font is too tall for selected media-size or orientation serial-port name is already in use name is not a serial-port
OTHER MESSAGES
Are also printed to the standard-error channel.-
labels loaded lid closed
RETURNS
slap returns failure if any of the above error-messages is emitted. Otherwise slap returns success.SEE ALSO
lp(1), lpfilter(1m), lpadmin(1m) (UNIX System V Reference Manual);lpr(1), lpd(8), printcap(5) (UNIX BSD 4.2 Reference Manual).
VERSION
slap 2.4.4 09feb2001 MJS
AVAILABILITY
slap can be built on any system conforming to IEEE Std 1003.1-1988 with Standard C Language Binding (ANSI X3.159-1989, hosted program environment).In practice, this includes:
- UNIX System V release 3.2 and derivatives
UNIX BSD 4.2 and derivatives, if you have an ANSI C compiler and libraries
OSF/1
Linux (Slackware, Redhat, SLS, Yygdrasil, etc)
transIDRIS v3
ESIX
Coherent
etc etc etc
NOTES
"Smart Label Printer" is a registered trademark of Seiko Instruments USA Inc.PLATFORM ISSUES
Some platforms have a tcdrain() function that does not conform to POSIX.1 specifications. This manifests itself as the inability to drive the SLP-Pro, SLP-100, SLP-120, SLP-200, SLP-220 and SLP-240 (printer is always reported as "not reponding"). On such platforms, you may need to set TCDRAIN_MAYBE_BROKEN=1 in the generated makefile.The SLP-100, SLP-200 and SLP-240 printers only work with host serial-ports capable of 57600 baud. For x86 systems, ancient 8250 UARTs will not do for these specific printer models. SGI Iris-4D family systems will not be able to use these specific printers. See also "Buggy Serial-Port Drivers", below.
Baud-Rate Mapping
Older UNIX systems do not provide a native way for programs to set a serial-port to operate at 57600 baud, even if the port hardware itself can do it. A few serial-port device-drivers can be configured to map requests for a lower speed into a hardware-specific command to set 57600 baud. This is known as "baud-rate mapping".Unfortunately, the actual lower baud-rate to request to get 57600 baud is system- and often device-driver-specific, thus slap supports various mapping schemes, selected by the -x# flag:
- -x2
- uses "50 baud" as a synonym for 57600 baud. This allows use of the SLP-100, SLP-200 and SLP-240 on the IBM RS/6000 under AIX 4.x, if the printer is attached to either a 7318 8-port concentrator or a 128-port adaptor, and the port has been initialised with the command "/usr/lbin/tty/stty-cxma fastbaud tty#".
- -x3
- uses "75 baud" as a synonym for 57600 baud. This allows use of the SLP-100, SLP-200 and SLP-240 on Sun SPARCstation and SPARCserver systems under Solaris 2.1-2.4, if the printer is connected to a Magma 4SP, 8SP or 16SP SBus card (or one of their SYNC or DMA variants). NOTE: baud-rate mapping is not needed for Solaris 2.5 and later releases.
Buggy Serial-Port Drivers
The Solaris "zs" device-driver for the built-in serial-ports of Sun SPARCstation, SPARCserver, Ultra-1 and Ultra-2 systems claims to be able to support 57600 baud, but actually messes up if you try to set such a speed. Thus the on-board serial ports of these systems cannot be used with the SLP-100, SLP-200 and SLP-240 printers; and requires the "-b38400" flag to drive the SLP-120 and SLP-220 printers. This applies to all Solaris releases from 2.1 to 8.Note that this driver bug does not apply to any known SBus add-on serial-port card.
BUGS
If someone is foolish enough to switch the printer off (or unplug the serial cable) whilst the printer is actually printing, it takes a little while (between 20 and 60 seconds) for slap to notice and complain.There should be a flag to enable "auto-linefeed", to allow text that would fall off the side of the label to be printed on the next line down instead.
The ability to have multiple fonts per label (selected on the fly with inline escape-codes) is a possible future enhancement.
Automatic vertical-centering of text on the label is another possible future enhancement.
The ability to use fully scalable PostScript or TrueType fonts (instead of bitmap fonts in a custom format) would be handy - watch this space...
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre