Hacking an ancient Braille printer

My youngest daughter is blind but is otherwise a bright and energetic five-year-old. We’ve been teaching her braille over the past year, something my wife is particularly skilled at. Since it would be handy to be able to print braille materials ourselves, we looked into purchasing an embosser. Unfortunately, they all cost in the $4000+ range or more! My wife poked around and found an old one on eBay for only a hundred bucks. We bought it, figuring we could make it work.

embosser1

Wow, this is quite the contraption. You know you are working with something interesting when the serial number is only 3 digits. (Still not quite as interesting as the coffee roaster from Turkey that I use at the shop, which has a 2-digit serial.) The metal embosser comes embedded in a hard-shell suitcase and weighs about 50 pounds. It makes me think of some kind of Soviet-era missile launch contraption. It has a 5-pin AT keyboard input, a 36-pin parallel port, and a paper feed button. It takes 12-inch tractor-feed paper and sounds like a machine gun firing when it prints, punching out the dots against the backing of a steel plate. I literally can’t use the thing at night as it will wake up the whole house.

embosser2

First, I needed to hook it up to a PC. I had an old laptop with a real parallel port on it, but it gave up the ghost shortly after the printer/embosser arrived. My next option was to use a USB to parallel adapter. I purchased a Belkin one thinking it was a prominent brand that should be well-supported. That turned out to be untrue. The drivers for this were pretty flaky. I was able to get it to fly eventually though. The Mac drivers were a disaster, so I decided to stick with Windows for the time being.

usb-p

I set it up as a “Generic Text Only” printer in Windows and tried sending some text files to it. It quickly became apparent that data had to be streamed to this thing in just the right fashion to keep it happy. The main problem I ran into was that carriage returns causes two lines to be skipped, wasting a lot of space. Using NotePad++, I was able to easily change some of the finer details of the ASCII data I was printing. I Tried unix-style line breaks, and the alternates. No dice. After a bunch of trial runs selecting different paper sized to see what effect they had, I concluded that I had to not send any page margin meta data at all to keep the old thing from flipping out.

embosser-screenshot1

embosser-screenshot2

A lot of searching online yielded a reference to rawprn.exe, a tiny executable compiled from a piece of C++/Win32 API code released by Microsoft in 2000. The original reference is here. This truly streams raw bytes to the printer – straight text with no margin information or page breaks or headers, or whatever. Just what I needed.

// Send the data to the printer.
	if( ! WritePrinter( hPrinter, lpData, dwCount, &dwBytesWritten ) )
	{
		PrintError( GetLastError(), TEXT("WritePrinter") );
		EndPagePrinter( hPrinter );
		EndDocPrinter( hPrinter );
		ClosePrinter( hPrinter );
		return FALSE;
	}

embosser-screenshot3

I intend to modify this utility to replace line breaks with padded spaces, keeping in mind that the width of each line is exactly 42 characters on this device. I’ll also need to issue an actual page forward command after 25 rows so it skips the perforrated page seperator and resumes printing on the next page. I was able to print some documents in the proper contracted “grade 2″ shorthand of braille with good results using this method. I’m going to update this post in a few days when I get a chance to build a fully-functioning script. At this, point, I’m still messing with the files ahead of time by hand.

embosser-screenshot4

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>