Mark Whitis's Website Home Page Linux Book: Linux Programming Unleashed My Resume Genealogical Data Contact Info Security About

pbm2lwxl - A driver for the Dymo/CoStar/Avery Label printers


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.

Many idiotic companies only write windows drivers for their printers and then their products only work with microsoft windows, and often not even with 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.


I am currently working on support for multipage postscript files. The latest version of the driver (probably newer than availible here) supports multiple PBM files on a single input stream as output by ghostscript. Unfortunately, pbmflip and pbmnoraw (which are used in the scripts) choke. I am now getting ghostscript to do the rotation, where desired. The current version works fine as long as there is only one label per print job. Nov 1999 Update: Dymo-Costar has sent me several of their printers for testing. I have tested the Turbo, EL60, and EL40. All work with the appropriate parameters (see table below).

Device Support

Brand Model Baudrate Dots Status Notes
DYMO LabelWriter DUO (96) USB 0922:0017 672 label
96 tape
Should Work 96 dot head for laminated tape. Appears as two separate USB printers. Limited tape support.
DYMO LabelWriter DUO (128) USB 0922:001D 672 label
128 tape
Should Work 128 dot head for laminated tape. Appears as two spearate USB printers. Limited tape support
DYMO Labelwriter Twin Turbo USB 0922:0018 672 Should Work Need to send ESC command to switch tapes.
DYMO LabelWriter 400 USB 0922:0019 672 Reported Working  
DYMO LabelWriter 400 Turbo USB 0922:001A 672 Should Work  
DYMO LabelMANAGER PC USB 0922:0011 ? unknown Laminated tape. Reported usblp driver had problems in 2004. Worth retesting since some of the other Dymo USB printers work.
DYMO LabelManager PC II USB ? unknown Laminated tape
DYMO LabelManager 450 USB unknown Laminated tape. Standalone or PC
DYMO Rhino 6000 USB ? unknown Laminated tape.
DYMO Rhino 6500 USB ? unknown Laminated tape.
DYMO DiskPainter USB ? No CD/DVD printer, radial printing.
CoStar LabelWriter II 9600 192?/128? Should work  
DYMO/CoStar LabelWriter XL 19200 192 Tested - works  
DYMO/CoStar LabelWriter XL+ 19200 448 Should work  
DYMO/CoStar EL40 19200 192 1-1/2" wide Tested. Works.  
DYMO/CoStar EL60 19200 448 2-1/4" wide Tested. Works.  
DYMO/CoStar Turbo 115200 448 2-1/4" wide Tested, works  
DYMO/CoStar SE250 115,200 448 Should work  
DYMO/CoStar SE250+ ? 448? Should work 115.2Kbps
DYMO/CoStar ASCII ? 192? Should work 115.2Kbps
DYMO/CoStar ASCII+ ? 448 Should work 115.2Kbps
Avery Personal Label Printer 9600 128 Tested - lower resolution approx 128x128 dpi
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
DYMO/CoStar LW300 115200 300? 1-1/2" wide Not tested. Will Probably work.
(Reported to work)
Has Serial and USB
DYMO/CoStar LW330 115200 700? 2-1/4" wide Not Tested. Will probably work. Has Serial and USB
DYMO/CoStar LW330 Turbo 115200? 700? 2-1/4" wide Reported to work with serial. Reported to work with USB with kernel 2.4.15. Has serial and USB.
300dpi. Use -r300x300 in ghostscript command.
Since the Avery unit has lower resolution, there are a few problems. Random garbage is printed on some lines. This is probably the result of sending more bytes of data per line than the printer expects. There is also an offset problem (the last 128 pixels get printed, not the first) unless you specify a label width of 128 when invoking pbm2lwxl. Effective label size (standard 1-1/8x3.5" labels) is 128x448 pixels.

These printers do not autobaud; use only the single baud rate supported by the printer. Use the correct label width or you probably won't like the results.

DYMO serial printers

Some of the dymo printers are just the old costar models.

DYMO USB printers

The DYMO USB printers use the same commands as the older EL series RS-232 serial printers and they use a standard USB printer class driver. This means that you should be able to use this driver just by sending the output to the appropriate device - which depends on how many USB printers you have on your system and what order they were enumerated (for example /dev/usb/lp0). You should not try to use "stty" to set the baud rate. The twin tape models (Twin Turbo and Duo) should also work. The Twin Turbo requires a special escape sequence be sent to it to select which tape to print on. The DUO appears to the computer as two separate USB printers so you select which tape to print on by using the appropriate USB device (/dev/usb/lp0 vs /dev/usb/lp1, for example). Note that if you disconnect and reconnect a printer, power off a printer, install another printer, or reboot, that these actions individually or in combination may affect the usb device name assigned to that printer.

The duo laminated tape printer has a somewhat different command set supporting a limited subset of the normal commands plus a few extra for tape specific issues. Special commands set the heat sensitivity of the tape and cut the tape. Older printers had a 96 dot printhead, newer ones have 128. The basic print command is the same, so this driver should print on the laminated tape but it won't set the correct heat setting or cut the tape (ESC E).

Special commands not directly supported by the driver can be sent using the shell printf command (these commands work on the USB models):

Standalone example:
  printf "\x1bq1" >/dev/usb/lp0   # substitute the correct device name
Pipeline example (print queue use):
 ... | pbmlwxl ... | (printf "\x1bq1"; cat -; printf "\x1bq2") | ...

printf "\x1bG"      # Short form feed for multiple labels in same job,
                   # avoids reverse form feed to print next lable
printf "\x1bq1"      # Select left roll on twin turbo
printf "\x1bq2"      # Select right roll on twin turbo
printf "\x1b@"        # reset printer, any unprinted data lost, top of form set true
printf "\x1b*"       # restore default settings
printf "\x1bV"       # return revision letter/number

#print speed
printf "\x1bh"       # text speed mode
printf "\x1bi"       # barcode/graphics mode
                     # slower speed mode for better graphics quality
# print density 
printf "\x1bc"       # light printing  (75%)
printf "\x1bd"       # medium printing (87.5%)
printf "\x1be"       # normal printing (100%)
printf "\x1bg"       # dark printing (112%)

# Duo laminated tape heat sensitivity commands.   
# documentation is a little vague, so this is a guess
# Not sure how the third byte is to be sent or if it is to be sent at all
# Printer may autodetect, so try leaving off the %c and the trailing number.
# and just try 'printf "\x1bC"' if these don't work.
printf "\x1bC%c" 0   # Duo laminated tape: Black on white or clear
printf "\x1bC%c" 1   # Duo laminated tape: Black on blue
printf "\x1bC%c" 2   # Duo laminated tape: Black on red
printf "\x1bC%c" 3   # Duo laminated tape: Black on silver
printf "\x1bC%c" 4   # Duo laminated tape: Black on yellow
printf "\x1bC%c" 5   # Duo laminated tape: Black ongold
printf "\x1bC%c" 6   # Duo laminated tape: Black on green
printf "\x1bC%c" 7   # Duo laminated tape: Black on fluorescent green
printf "\x1bC%c" 8   # Duo laminated tape: Black on fluorescent red
printf "\x1bC%c" 9   # Duo laminated tape: white on clear
printf "\x1bC%c" 10   # Duo laminated tape: white on black
printf "\x1bC%c" 11   # Duo laminated tape: Blue on white or clear
printf "\x1bC%c" 12   # Duo laminated tape: Red on white or clear

printf "\x1bE"        # cut tape

I can't find any technical documentation on the DYMO LabelManager line of laminated tape labelers with USB (some models). They probably use the same protocol as the laminated label printer half on the duo which is more or less compatable with this driver. Back in 2004, someone reported having problems getting the linux usblp (USB printer class) driver to recognize the original LabelManager PC but this needs to be retested with a newer kernel version since it was a USB printer class device.


Download pbm2lwxl.tar.gz


Copyright 1999 by Mark Whitis. All Rights Reserved. Availible under this license. Not GPL tainted.


In the commands below, /dist is the directory on your system where you download distribution files prior to installation. Substitute a suitable directory on your system or make /dist a symbolic link to a directory created for the purpose on a disk partition with sufficient free space.

   cd /dist
   cd /usr/local/src
   mkdir pbm2lwxl
   cd pbm2lwxl
   tar zxvf /dist/pbm21wxl.tar.gz
   make install

"make install" does not make any attempt to integrate with the printing system on your system.


The labelwriter XL uses 19200. Older models use 9600 The printer uses xon/xoff - configure spooler appropriately or use something like: "stty 19200 ixon -onlcr usage: pbm2lwxl [ width [height] ] For example: # Make sure you specify the correct baud rate for your printer model stty 19200 ixon -onlcr /dev/cua1 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.

Obviously, you need to redirect a PBM file into the standard input of the program.


You may need to edit the pathnames to the pbm2lwxl utility in these scripts. Since lpd does not establish a reasonable path, I hardcoded the pathnames to /usr/local/bin/. 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.


Apparently, lpd recognizes XON/XOFF on serial ports. This is good since there does not appear to be a way to configure that (the fs printcap directive seems inadequate). So, here is a sample configuration for text.


Other companies


The avery units are relabeled older costar units (I suspect the labelwriter II) - they look identical inside and out and the Avery units even say "COSTAR" inside.

The Avery Personal label printer prints at 1" per second, according to the meager specifications.


This program will not, as far as I know, 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.


I know nothing about sony label printers


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.


I don't know about the kroy label printers such as the K-225 and K-227. Are they relabeled dymo printers, seiko printers, or another beast entirely? Also, these label printers are not to be confused with any multilayer tape labelers (p-touch or casio style) sold by kroy.

Industrial Bar code printers

I don't have any information at the moment on the industrial strength bar code printers.


The following was from an Avery Personal Label Printer
Chip: (Motorola logo) SC408056FN 600100-030 COSTAR REV D 2C83JQQKV9152
  (Probably a mask programmed 68HC11 processor)
Chip: 74HC04N
Chip: 75HC423N
Chip: 2x (ST logo) PBL3717A 89134C
Chip: Max232N
Chip: 2xUA7805C
Chip: P8P10 (T0-220)
Marking: ASSY PART NO: 60100-032
Marking: COSTAR CORP 400032 REV D


For more information on the postscript language, get a copy of Postscript Language Tutorial and Cookbook and the Postscript Language Reference Manual.

One of the most common problems you will have with these label printers is that a postscript page is laid out so that the text prints at the top of a normal 8-1/2x11 page and the area which is rendered into the bitmap is a small rectangle in the lower left corner. Even if you only print 6 lines on the page, they will typically be at the top. The lower left hand corner is used as an origin (this makes better mathematical sense but printers and monitors work the other way) rather than the top left which causes unexpected things to happen when printing other paper sizes. This is why the funny margin options are used with mpage above.

It might be helpful to define new paper sizes in mpage would probably need to be updated. mpage would benifit from a page definition database which specified where each little page went on the page. This would be useful for all sorts of laser and inkjet printer labels.


The LableWriter XL supports a form of RLE image compression. I don't know if the older printers support this. The driver uses the raw, uncompressed, image data format. On some models, the serial port might slow down the printing with uncompressed data.



Set the variable debug to 1 in pbm2lwxl.c (or set it using gdb).

Continuous paper

Thermal adding machine paper can be used instead of labels. You will need to send a label length of -1 to the printer to disable the hole sensor; if the second argument to pbm2lwxl is a Cheap thermal paper can be handy for testing purposes or for applications such as a cheap point of sale receipt printer (using the wide model, preferably), cheap tape over shipping labels, etc. For line by line printing applications, you may want to use pbmtext instead of ghostscript and disable the formfeed command in the software.

pnmcrop is handy with pnmtext to trim the excessive border produced by pnmtext.

Look at the script "fontdemo" for a sample of receipt style printing.

Label stock

Labels are availible from avery and costar, among others. Labels are availible in a variety of sizes.

EIMINC can make custom labels specifically for barcoding; they claim these labels are more durable and are IR scanable. They also sell tamper evident labels but I don't think they work in thermal label printers.


This driver does not need any fonts or do any font handling; use whatever fonts are availible for postscript or pbmtext. As a convenience to users of pbmtext, an X windows font grabbing utility (grabfont), a demonstration of how to use them in receipt printing mode (fontdemo) are included.


An image of TUX the penguin

netpbm and ppmcie test image

Since some people are unfamiliar with the netpbm tools, this section is going to show how a color image is transformed, one step at a time, into a monochrome image suitable for printing. Since your web browser probably can't display PNM images, I have substituted PNG and, in one case, JPEG for online display.

The ppmcie program, included with netpbm, can produce a color plot of a CIE chromaticity diagram, which is handy if you understand color science, at any resolution. When converted to black and white, it produces a dithered blob with labeled axes. While it is not an image you would think of as being appropriate for a black and white label printer, it prints labeled axes that fill up the full image, give or take a few pixels, and thus can be helpful in checking if your labels are being clipped. I also find it useful for illustrating how the netpbm tools change images.

ppmcie -width 900 -height 600  >/tmp/junk.pnm
pnmfile /tmp/junk.pnm
eog /tmp/junk.pnm &
# I compressed this one using JPEG for web display because it uses about 
# a quarter million colors at this resolution resulting in a very large file
# and we don't care about JPEG artifacts and loss if we are just taking a peek

[PPM version of ppmcie image]

ppmcie -width 900 -height 600 | ppmtopgm  >/tmp/junk.pnm
pnmfile /tmp/junk.pnm
eog /tmp/junk.pnm &
# Note that this image is relatively constant brightness because, in theory, 
# everything is supposed to be the same brightness (except the area outside 
# the triangle which is darkened to show that it can't be accurately 
# represented on screen.
[PGM version of ppmcie image]

ppmcie -width 900 -height 600 | ppmtopgm | pgmtopbm >/tmp/junk.pnm
pnmfile /tmp/junk.pnm
eog /tmp/junk.pnm &
[PBM version of ppmcie image]

ppmcie -width 900 -height 600 | ppmtopgm | pgmtopbm | pnmflip -cw > /tmp/junk.pnm
pnmfile /tmp/junk.pnm
eog /tmp/junk.pnm &
[rotated PBM version of ppmcie image]

ppmcie -width 900 -height 600 | ppmtopgm | pgmtopbm | pnmflip -cw | pnmnoraw >/tmp/junk.pnm
pnmfile /tmp/junk.pnm
eog /tmp/junk.pnm &
[rotated PBM version of ppmcie image]
# Same as above, but now in ascii PBM format instead of RAW (binary) PBM format
pbm2lwxl 600 900 <junk.pnm >/dev/usb/lp0

Change the width and the height to the resolution you think is appropriate for your printer and label.

Now, we can make a simple script that will take most image formats and print them on the printer:

anytopnm $1 | ppmtopgm | pgmtopbm | pnmflip -cw | pnmnoraw | pbm2lwxl 600 900 >/dev/usb/lp0

Adjust the sizes and device name as appropriate for your configuration. Be sure to exit eog each time if you reuse file names or eog will show you an old version of the image.

This example converted: jpeg,etc. -> PPM -> PGM -> PBM -> (pnmflip -cw) -> NORAW -> driver

PAM/PPM/PGM/PBM/PNM are a family of file formats used by the netpbm utilities. Different formats are used depending on whether you have 1 bit monochrome, 8 bit greyscale, 24 bit RGB color, or higher color formats:

Each of those has an ascii variant and a more compact raw (binary) variant. "man netpbm" will help a bit. Each command also has its own manpage. The pbm2lwxl driver only takes PBM input and only the ASCII version, not the raw format. NETPBM utilities will promote an image to a format with more colors (i.e. PBM or PGM when expecting PPM or PBM when expecting PGM) but to truncate the number of colors (PPM to PGM or PBM or PGM to PBM) you need to do that explicitly.

By the way, JPEG is a very inappropriate format to use as an intermediate form for labels. It is a lossy format for real world images, you want a format more appropriate for simple computer generated graphics such as PBM, PGM, PPM, PNG, GIF, or uncompressed or losslessly compressed versions of TIFF.

A PDF/postscript label example

Dave Schuler (thalian at compuserve dot com) asked for some help printing a label and was kind enough to let me use his image as an example. The orinal PDF file is here; it was generated with the ROS PHP PDF library. Note the troublesome oversize margin at the bottom which will ultimately result in the label image being clipped. It looks like this (PNG substituted for PBM for web display): [Sample badge image]

Here is a filter to take a color pdf or postscript file of a 600x900 image that has been misaligned with an 80 pixel margin and convert it to a form the driver can use:

 ghostscript -sDEVICE=pgm -r300 -g900x680 -dNOPAUSE -dBATCH -q -sOutputFile=- testcard.pdf | pnmcut -bottom 600 | pgmtopbm -threshold -value 0.42 | pnmflip -cw | pnmnoraw >testcard.pbm

The result looks like this:

[Sample badge image, processed]

The threshold value above was chosen carefully for this particular file. Note how ghostscript was given an image size 80 pixels oversize and then pnmcut was used to crop 80 pixels off the bottom.

Now, lets look at the same image using dithering instead of thresholding (PNG substituted for PBM for web display):

 ghostscript -sDEVICE=pgm -r300 -g900x680 -dNOPAUSE -dBATCH -q -sOutputFile=- testcard.pdf | pnmcut -bottom 600 | pgmtopbm | pnmflip -cw | pnmnoraw >testcard.pbm
[Sample badge image, processed]

Here is a simpler version which was done on the same file. The image isn't rotated and the margins aren't fixed but is otherwise ready for the printer driver. ghostscript converts color/greyscale to monochrome using halftoning instead of dithering which really isn't appropriate. (PNG substituted for PDF for web display).

 ghostscript -sDEVICE=pbm -r300 -g900x680 -dNOPAUSE -dBATCH -q -sOutputFile=testcard.pbm testcard.pdf
[Sample badge image, processed]

As you can see, the halftoning looks much worse than dithering. See how difficult the halftoned version is to read. This image would look better overall if a black background was used instead of the green on the bottom half. Dithering is ok on the top half where the characters are bigger.

Distribution Specific

Old redhat versions

Not worth the trouble fixing the printtool. Just create the queue entry in /etc/printcap and input filter manually and keep a backoup copy of printcap incase printtool clobbers it.

It would involve a bit of work to extend the redhat printtool/printfilters to handle label printers.

The redhat print tool needs to be extended to understand the concept of one or more postprocessors after ghostscript. Additional fields should be added to their printer database /usr/lib/rhs/rhs-printfilters/printerdb. Printfilters should be added to convert ps-to-pbm and then pbm-to-printer.

redhat does understand the idea of a final filter that actually sends the data directly to the printer (smbprint), etc. although that is all hard coded into the main filter script.

The redhat print filters also seem to have a problem in that if they are starting from ascii they will apparently invoke asc-to-printer; it is not a valid assumption these days that the printer can handle ascii. They seem to make the mistake in assuming that any of the *-to-printer.fpi filters can actually be used. It bypasses its own "DESIRED_TO" format.

Redhat 7.1

### dymo label printer
rpm -i printconf-0.2.12-1.src.rpm
rpm -ba /usr/src/redhat/SPECS/printconf.spec 
cd /usr/src/redhat/BUILD/printconf-0.2.12/src
echo pbm2lwxl >>redhat_gs_driver_list 
python util/  foomatic/data japanese printer_db.pickle redhat_gs_driver_list
patch printconf-gui <<\...EOF...
--- printconf-gui.orig	Wed Mar 28 11:51:22 2001
+++ printconf-gui	Wed Jul 18 03:22:20 2001
@@ -278,6 +278,12 @@
 # This being a printing system, it's probably a good idea to go and see if there are any printers attached locally.
 # There are much more intelligent approaches to this problem, but the rest of the system isn't sophisticated enough
 # to care yet, so simply scaning likely devices to see if they can be opened for writing is sufficient.
+# Added serial ports which are needed to support Avery, Dymo, and Costar
+# label printers, among others.  And yes, we definitely need more than
+# for serial ports here.  My label printers are attached to
+# a byterunner 8 port board with ports from ttyS16-ttyS23
+#    - Mark Whitis <>
 local_printers = []
 for devlpx in [	'/dev/lp0',
@@ -286,7 +292,40 @@
-		'/dev/usb/lp3']:
+		'/dev/usb/lp3',
+		'/dev/ttyS0',
+		'/dev/ttyS1',
+		'/dev/ttyS2',
+		'/dev/ttyS3',
+		'/dev/ttyS4',
+		'/dev/ttyS5',
+		'/dev/ttyS6',
+		'/dev/ttyS7',
+		'/dev/ttyS8',
+		'/dev/ttyS9',
+		'/dev/ttyS10',
+		'/dev/ttyS11',		
+		'/dev/ttyS12',
+		'/dev/ttyS13',				
+		'/dev/ttyS14',
+		'/dev/ttyS15',						
+		'/dev/ttyS16',
+		'/dev/ttyS17',
+		'/dev/ttyS18',
+		'/dev/ttyS19',
+		'/dev/ttyS20',
+		'/dev/ttyS21',		
+		'/dev/ttyS22',		
+		'/dev/ttyS23',		
+		'/dev/ttyS24',		
+		'/dev/ttyS25',		
+		'/dev/ttyS26',		
+		'/dev/ttyS27',		
+		'/dev/ttyS28',		
+		'/dev/ttyS29',		
+		'/dev/ttyS30',		
+		'/dev/ttyS31'
+		]:
 		os.close ( (devlpx, os.O_WRONLY | os.O_NONBLOCK))

# chown lp /dev/ttyS16

# buggy cp, can't overide -i with -f
yes | cp printer_db.pickle /usr/share/printconf/printer_db.pickle
yes | cp  printconf-gui /usr/sbin/printconf-gui

printconf-gui &
   # Interactive, GUI
# after configuring printer in printconf-gui, add :br#19200: in /etc/printcap
# (which will unfortunately be erased next time printconf-gui runs)
emacs /var/spool/lpd/lbltst/ 
  # change 
  #    "| pnmflip -cw | pnmnoraw | pbm2lwxl" 
  # to  
  #    "| pbm2lwxl 448 1500"
  # which defines a lable size of 2.125x8" (the length will be truncated
  # based on how many lines ghostscript outputs)
  # note this will give non-rotated output.  If you want rotated output
  # you will need to reverse the width and height in all label 
  # size definitions, put the pnmflip and pnmnoraw commands back, and
  # remember to add the options to pbm2lwxl.  Better yet, figure out
  # how to get portrait/landscape printing options to ghostscript
  # once it is working, you may want to move from /etc/printcap
  # to /etc/printcap.local so printconf won't hurt it.

Technical Documents

Technical manuals are very well hidden on the dymo website.

Company Involvement

This driver was written using a document (Lwxlprog.txt) downloaded from costar's web site. Programming documents, SDKs, etc are at their Developers Libary (broken link) including the LWXL programming Document (broken link) . Costar sent me several models of printers for testing purposes. Tim Kissane at CoStar runs Linux at home and has gotten some other people inside the company working Linux.

Lately, however, the company has been less responsive. Their website is unusable due to javascript abuse and I haven't been able to get intelligent answers to questions let alone

Common Problems

If the last half of the line seems garbled on 7x14 and 7x13 fonts in fontdemo, you are probably being bitten by newline translation. Try "stty -onlcr <$device".

If XON/XOFF flow control is not working, garbage may be printed.

If you have any funny settings for xterm in your xdefaults, this will affect grabfont.

Serial Port Troubleshooting hints

USB Troubleshooting

I have not personally tested any of the printers with the built in USB, although one report apparently indicated one worked with kernel 2.4.15.

Note that the USB support in the early 2.4.x kernels was pretty sketchy. On my system, the dymo USB to serial adapter causes a crash on kernels <2.4.9 and even with 2.4.9, I don't think it actually transmits date correctly.

Try devices such as /dev/usb/ttyS0, /dev/usb/lp0, and /dev/ttyU0. You mileage may vary depending on your system configuration.

Look at /proc/bus/usb/devices, /var/log/messages, etc. Do you have usbdevfs configured? Devfs configuration in /etc/devfsd.conf might also affect what devices are availible.

lsmod. Is the module usbcore loaded? How about the ohci or uhci driver? How about the USB serial (various names, such as mct_u232.o for the dymo USB to serial adapter) or USB printer kernel module (printer.o).

CUPS printing system

There are several drivers availible under CUPS:

Note that printing through CUPS you run the risk of your image being resized, resampled, or inappropriate margins applied. It is generally safer to bypass the printing system if you have already have a properly formatted image. If you are trying to print a raw raster image through CUPS experiment with options like "lp -o position=bottom-left" to see if they help. If CUPS doesn't have your model number listed, try selecting an older model with a similar tape width and resolution.


No bugs have been reported.

Cable Pinout

View of contact side of modular plug.  Pin numbers correspond to
25 pin female D connector on opposite end of cable. .
                             DB25   DB9
cable       |    --- 2   ++    2     3 
------------|    --- 3    |    3     2
------------|    --- 7    |    7     5
            |    --- 20  ++   20     4
   (thanks to Emile Nguyen for the DB9 pinouts).

Ghostscript issues

One of the problems with label alignment is that when you set the resolution in ghostscript with the -rXXXxYYY parameter and the page size with the -gXXXxYYY parameter, this doesn't set the page size and thus the page origin to something sane (i.e. inside that box). The -dDEVICEWIDTHPOINTS=w and -dDEVICEHEIGHTPOINTS=h parameters might help. Or, maybe ghostscript does and applications are just dumb as which assumes origin in lower left corner seems to work correctly. Ghostscript also doesn't let you ask for rotation on the command line. -dORIENT1=true doesn't seem to help. You can include the setup file on the command line before files to be printed but where that file is located varies with ghostscript version and it by default rotates in a direction not very appropriate for these label printers (though it contains examples of how to rotate in other directions). Looks like we want the last example in that file.

Ghostscript uses a halftone screen instead of dithering. That looks like crap. Discussed elsewhere on this page.

Label Rotation

pnmflip limits you to one label per print job. A better way is to use the file

cat | ghostscript -sDEVICE=pbm -r300x300 -g600x900 -dBATCH -q -dNOPAUSE -dSAFER -sOutputFile=- - | pbm2lwxl
This means that the typical foomatic entry which looks something like this:

gs -sDEVICE=pbm -sOutputFile=- -q -dNOPAUSE %&&A -dPARANOIDSAFER - -c quit | pnmflip -cw pnmnoraw | pbm2lwxl
Should be rewritten to look like this:

gs -sDEVICE=pbm -sOutputFile=- -q -dNOPAUSE %&&A -dPARANOIDSAFER /path/to/file/ - -c quit | pbm2lwxl
Where /path/to/file/ is wherever you put that file. Perhaps /usr/share/pbm2lwxl/ Or, you just use it when you print a file. Maybe you want the default orientation to be portrait. However, for the most part, users expect address/shipping type labels to print in landscape mode.

Print in the lower left hand corner!

If your label comes out blank, you are probably forgetting this rule. First, try to set the page size correctly, if possible. If that doesn't work, set a top margin that is the difference between the page size the program thinks it is using and the label size.

It is necessary to get the application to print in the lower left hand corner of the page if it uses a page size that doesn't match the label size. The lower left hand corner is the postscript origin but applications usually immediately offset the first lines of text about 10.5 inches up the page. Which is exactly what they should do on US letter or A4 size paper. Ghostscript is a graphics oriented system and therefore puts the page orientation in the lower left hand corner which is exactly where it should by (mathematically: right handed coordinate system). Unfortunately, this is confusing to users and programs which are used to thinking from a dumb primarily text oriented printer (dot matrix, daisywheel, inkjet) point of view where if you print some short lines in the upper left hand corner they will be properly aligned no matter what the paper size. So, programs which don't let you set the paper size and think in terms of dumb printers put the text (or other content) in the wrong place.

The file contains a simple sequence of postscript commands to print 6 lines of text, printed relative to the lower left hand corner. Use it for testing or as an example for making your own labels.

Other Operating Systems

This should port easily to many operating systems.

Unix Compatible

This software should port easily to any unix compatible operating system, including FreeBDS, Solaris, SunOS, AIX, etc. The most likely change needed, if any, is to change which include files are used.

Microsoft Windows, any version, or DOS

DO NOT send me requests for assistance with any version of microsoft windows, with the possible exception of serious porting efforts. Dymo no longer supports the older printer models. If you are looking for a windows driver, look here or do an intelligent search on google. Remember to run a virus checker. If you have programming experience, you can try porting this driver or using dymo-costars windows SDK. But don't bother me me windows end user questions.

This program should port easily to DOS or the dos box on windows. The challange is how to get the output of this program to a serial port. On a pure dos box, you may need a library which supports interrupt driven I/O although simple redirection of standard output to COM1: may work (with appropriate MODE settings for buad rate, no translation, and XON/XOFF) since the data flow is output only except for XON/XOFF. On a dos window in windows, this may already be handled for you by windows if you open COMx:. Don't forget to enable XON/XOFF and disable any translation.

Have I made it perfectly clear that I do not provide tech support for windoze users?


More barcode software can be found on freshmeat.


This file is maintained by Mark Whitis (

Senior Engineer for hire
Software Development - Electronic Design - Embedded Systems - Device Drivers - System/Network Administration and Security - Motor Control, RobotCNC - Linux/Un*x - 25+ years experience
The author of these pages is looking for a new gig.

Engineers and electronic hobbyists: The new Open Symbol Project is creating open schematic symbols and PCB footprints for a variety of different CAD packages.

Mark Whitis's Website Home Page Linux Book: Linux Programming Unleashed My Resume Genealogical Data Contact Info Security About

All email messages received must pass the turing test or they will be considered SPAM. If it could have been written by a machine, it was.

Under no circumstances are you to email me with questions regarding windoze, any other microsoft operating system or application, or any software which runs under any form of windoze.