[HOME(Mark Whitis)]
[Contact]
[Resume]
[Browser Friendly]
[No Spam]
[FEL]
[DBD]
pbm2lwxl - A driver for the CoStar Labelwriter XL
Overview
pbm2lwxl is a device driver for the CoStar Labelwriter XL and
compatible printers. It takes plain (not raw) pbm files.
The PBM file format was popularized by the PBM (aka netbpm, pbmplus, etc)
utilities by Jef Poskanzer. There are utilities to convert from almost
any image format to PBM/PPM/PGM/PNM, and vice versa.
Ghostscript supports pbm output.
This driver was written in the C language for Linux
but should compile on any un*x compatible system as well as many
other operating systems; no operating system specific calls were used.
Writing a PBM filter is an appropriate way to write a printer driver
for a simple raster based printer.
- It can run entirely in user space
- Integrate with the standard lpr spooling system and ghostscript
rasterizing system
- It will work with any version of GNU Ghostscript, Alladin ghostscript, or
Artiflex Ghostscript, without recompiling. And, since the code is
not actually linked with the Ghostscript code, you don't need to worry
about GPL tainting or other licensing issues.
- Anything which can be printed with ghostscript (subject to the size/resolution/monchrome/1 bit per pixel restrictions of the device), can be printed on
a label. You can mix multiple sizes of text at various angles, bar codes,
images, etc. And you can do it in a way that is reasonably compatible
with laser and inkjet printers as well.
- Anything which can be converted to plain PBM format can be printed
directly (or you can go through pnm2ps, ghostscript, and back to PBM format).
- Quick and Easy. It took a couple hours to write the driver and a little
while longer to write documentation.
- Portable. The code will compile on any platform.
- Ghostscript is the native rasterization system on most operating
systems and can replace and/or work with the native system on almost any other.
- It can use existing serial/parallel/usb drivers
Many idiotic companies only write windows drivers for their printers and then
their products only work with microsoft windows, and often not even will all
versions of windows. Write a PBM or ghostscript
driver and your product will work with MS-DOS, Windows 3.1, Windows 95,
Windows 98, Windows NT, MacOS, OS/2, Linux, FreeBSD, NetBSD, OpenBSD,
4.3BSD, Solaris, Sunos, AIX, HPUX, Irix, Digital Unix, SCO Unix, Ultrix,
VMS, NeXTstep, Amiga, Plan 9, SMS/QDOS.
CoStar
|
LabelWriter II
|
9600
|
192
|
Should work
|
|
CoStar
|
LabelWriter XL+
|
19200
|
448
|
Should work
|
|
CoStar
|
EL40
|
?
|
192? 1-1/2" wide
|
Should work
|
|
CoStar
|
EL60
|
?
|
448? 2-1/4" wide
|
Should work
|
|
CoStar
|
Turbo
|
?
|
448? 2-1/4" wide
|
Should work
|
|
Avery
|
Personal Label Printer
|
19200
|
192
|
Tested - Ok
|
|
Avery
|
Personal Label Printer+???
|
19200
|
448
|
Should work
|
|
Sieko
|
any
|
n/a
|
n/a
|
Should NOT work.
|
See below
|
Sony
|
any
|
n/a
|
n/a
|
Unknown
|
See below
|
Download
Download pbm2lwxl.tar.gz
License
Copyright 1999 by Mark Whitis. All Rights Reserved.
Availible under this license.
Not GPL tainted.
The labelwriter XL uses 19200. Older models use 9600
I think the avery units are relabeled costar units - they look identical
inside and out
usage
The printer uses xon/xoff - configure spooler appropriately
or use something like: "stty 19200 ixon
usage:
pbm2lwxl [ width [height] ]
width and height are in pixels. width should be 192 (1") or 448
(wide models). You can redirect the output directly to the serial
port the printer is attached assuming you don't already have a spooler
running on that port and you have already set the baud rate and XON/XOFF
flow controls.
scripts
You may need to edit the pathnames to utilities in these scripts.
- ps2lwxl
Postscript to labelwriter
- txt2lwxl
text (6 lines x 29 char) to labelwriter
- small2lwxl
text (12 lines) to labelwriter
You will probably want to use one or more of the following utilities
mpage -1 -o -m720t0lrb -L6 - ascii to postscript
ghostscript -sDEVICE=pbm -sOutputFile=- -q -dNOPAUSE -r192x192 -g700x192 -dSAFER - -c quit
pnmflip -cw - to rotate 90 degrees
pnmnoraw - convert from raw to plain (ascii) pnm format.
Note that the ghostscript command shown above generates 700x192
which should be pnmflip'ed to get 192x700 for printing. Change "-L6" to
"-L12" on the mpage command to fit more lines on a label.
This program does not use libpnm. No particular reason. It was just
faster to write code which read a plain pbm file than to figure out
how to use libpnm and if its licensing was acceptable. libpnm is
more flexible but we really don't need that flexibility here.
lpr
I haven't integrated this with lpr yet. The biggest question is how to
set XON/XOFF. The documentation on fs/fc printcap directives is a bit
vague (to say the least). It is possible I might have to write
a trivial output filter program to do xon/xoff.
fs=IXON?????????:lp=/dev/cua1:br#19200:
Bar Codes
Check out pbmupc, part of the netpbm package, probably already installed on
most Linux boxes.
Other companies
Avery
The avery products look like rebranded costar products. I have
several of the 1" models around and will test them soon.
Seiko
This program will not drive seiko label printers.
For a driver program for seiko printers, check out
slap.
Slap is a rather bloated program which tries to reinvent the wheel
instead of cooperating with the existing rasterizer (ghostscript).
It comes with a bunch of fonts. The result appears to be that
you have a much more complicated program but much less flexibility
in printing labels.
Sony
I know nothing about sony label printers
Dymo
It looks like dymobought costar which
is now called Dymo-Costar.
Don't confuse these printers, however, with the continuous laminated
thermal transfer label tape printers made by Brother and Casio, some of
which were rebranded by Dymo. And certainly don't confuse these with
the even older mechanical embossing printers by Dymo or the old
Kroy mechanical ribbon transfer label makers.
Industrial Bar code printers
I don't have any information at the moment on the industrial strength
bar code printers.
This file is maintained by
Mark Whitis
(whitis@dbd.com).