views:

34

answers:

1

So i am designing an art project that will print to a dot matrix printer the contents of my internet history. i have found info online to parse out a plist (what os x uses to store internet history) so im all set on that front but what i am looking to find out is how to send a request to the printer to print a new line, which would happen when a new page is visited. i was wondering if it is possible in any of the following languages: objective-c, javascript, php, or processing/java, all of which i have a decent understanding of. I am have tried to do a little research before asking here and it seems like i may need to use shell commands, which i am not familiar with at all. the printer i will most likely be using is an EPSON LX-300 Dot Matrix Printer if that matters. i would like to do this on os x, but if i have to use windows that is an option. if anyone knows how to do this or can give me some direction that would be a huge help. thanks

+2  A: 

Here is how I might do it.

First, I suppose I might look around for a dot matrix printer with a modern interface and a Mac OS X driver. There might still be people printing multipart forms who need impact printers.

But failing that, I would then look for a serial (as in, RS-232 serial) printer and connect it to my mac via a USB-to-RS232-serial converter. Be careful, most of the generic such things don't work on the Mac, get a USB serial widget like this that specifically supports the mac.

Then, I would write the code in sh/bash and run it in a Terminal window. Those language systems you cite are overkill for this job, some lack system interfaces entirely, and the ones that can turn system knobs do it via complex interfaces. It's better to put together stty(2), echo(1), cat(1) et al and just get some strings to print.

DigitalRoss
Good advice; would +1 but I'm out of votes. This particular printer seems to have a direct USB connection, though. Out of curiosity, how would one write to such a printer in a shell environment? Is `lpr` the right tool for this?
Pekka
If it's possible to get a generic USB printer to work with your Mac then by all means skip my complicated serial solution. The reason I gave the complicated solution was because I was guessing that the Mac wouldn't talk to a printer it didn't recognize. I could be wrong about that.
DigitalRoss
that makes sense i do believe that the printer tht i am going to be getting only has the 9-pin serial connection and not usb so i would need that widget...and i understand what you're saying about the languages being overkill. as i am completely green when it comes to coding in sh/bash are there any resources you would recommend for a starter? also could you explain the `stty(2)`, `echo(1)`, `cat(1)` as im not sure what those are.
Joe
One thing that makes the Mac great is the fact that underneath that GUI is a more-or-less real Unix system. It would be better to search for a partner that already knows it, but you might try starting here: http://sage.ucsc.edu/~wgscott/xtal/wiki/index.php/Unix_and_OS_X:_The_Absolute_Essentials
DigitalRoss