views:

603

answers:

4

I was asked by my client to print the receipt into Epson TM U220 (http://pos.epson.com/products/TM-U220.htm) from my web application. I have no idea how to do that. is there any java applets or something else that I can use for printing ? or should i use jasper (is jasper has lib for helping to cope this problem?) (if there is flash apps that could be used, I have no objection to use it as well ...)

I am using Grails for my web apps.

A: 

Have a look at the java printing stuff available in the runtime.

Note that driver support is os-dependent.

Thorbjørn Ravn Andersen
A: 

My understanding of applets and printing is that your applet must be signed as well.

Chris Lively
+1  A: 

You don't need an applet, from a grails controller you may use any Java library. Use the Java printing services available to the runtime in javax.print. This is assuming that the printer is installed where the grails runtime is running.

Cesar
+1  A: 

I created an app to write to a receipt printer for a POS system a while back. The way we did it was to just open a printwriter that pipes to the correct receipt printer. We manually sent the character codes to the printer to create bold, underline, font changes, etc because of requirements from the client that we do it that way (there was another application that used these character codes and they wanted us to use them also).

If you don't want to go through the manual process like I did a good choice is JavaPOS. It has got alot of stuff related to printing to receipt printers (definately much more elegant than I described above). You'll find it at http://www.javapos.com/.

SOA Nerd