jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Printing on line printers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Printing on line printers" Watch "Printing on line printers" New topic

Printing on line printers

Victor Campos

Joined: Sep 17, 2007
Posts: 4
Hello ppl ^^
I'm actually developing a webapp for printing some receipts that are generated on a system made on Ruby on Rails (with actually almost no documentation for serial/printer communication).

So, my problem is: I've got some "line printers" (here in Brazil also called "matricial" which would mean "matrix" although I think that this is a bit wrong as these printers have a fixed character set) and need to make Java print on it! I found the documentation about javax.print package but actually haven't found if it works with this old type of printers... Anyone have a clue about it?

Thanks for the attention
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Welcome to the JavaRanch.
Your first step should be to contact the printer manufacturer. They may have an API or driver to interface with the printer. The javax.print API sits on top of the OS's print functionality, so if you can't print from your OS, you can't use javax.print from within Java.
Can you use ASCII characters to control the printer (i.e. CR, LF, FF and so on)? You may be able to just send them and plain characters to the printer via the serial port.

[How To Ask Questions On JavaRanch]
Victor Campos

Joined: Sep 17, 2007
Posts: 4
Uhmm, that's a good solution, I did it a while ago but using C++ and serial port communication, but as my application will have to communicate with a database I sorta dropped C++, so gotta try this on Java

Thanks again!
[ September 17, 2007: Message edited by: Victor Campos ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Printing on line printers
It's not a secret anymore!