2015-08-26 – There is now a web version of this tool. Visit http://laemeur.com/dotmat-web to check it out.

Simulated print of an Okidata printer


That’s the tagline from an old advertisement for the Okidata μ84 (a close cousin to the μ92 that I had when I was a kid), and it’s apt, I’d say, for dot-matrix printers in general.

Okay… you may or may not agree with the Stradivarius comparison, but I think they are beautiful instruments, and they produce beautiful music, in the air and on the page.

In an effort to capture some of the latter effect, I wrote an uncomplicated Perl script to simulate the hardcopy of of a 9-pin printer. If you’re not shy about using the command-line, and you’ve got Perl installed, you can download it and try it out here:

Usage instructions:

#     feed me an ASCII-encoded PBM file, like so: 
#         $ ./dotmat.pl INFILE.PBM
#     I will barf back out a binary PGM file to STDOUT, so if you want
#     that in a file, do like this:
#         $ ./dotmat.pl INFILE.PBM > OUTFILE.PGM


The image atop this page (40% of output size) is the script’s output for the following input bitmap [this is actually output from an older version of the script]:

Bitmap image of Okidata printer

Usage Notes

A few things to keep in mind when using the program:

Future Plans

At present, this script handles the very simple task of transforming a bitmap image to a high-res simulated print. Printing graphics isn't exactly what impact printers were designed for, and certainly not what they're most commonly used for. Having a print simulator that could generate output from a text file would be useful. I'd like to extend the script to do that at some point.

Handling dot-matrix printer fonts is not quite as straightforward as "printing" an array of dots, however. Some research and sample font acquisition is needed before proceeding.

That is all! If you use the script in an interesting way, I’d love to hear about it.