right now i'm developing an application for a company in Seam 2 for Point Of Sales, and my client wants to print the invoice directly from the application. Currently, i just generate the PDF of the invoice and the user chooses the printer and press the print button, but they want to do that faster, also they have 2 printer: An EPSON TM U220 for the tickets and a normal printer for the invoices. So, i want to investigate about printing directly from web page.
I've heard about the most accurated alternatives: Java Web Start and Applets, but i don't know which is the best in order to achieve that. I read that with applets you have to deal with authentication stuff or permissions (well, maybe with JWS too but a little bit less) and that Applets are discontinued; and on the other side with Java Web Start, i can develop basically a simple application that prints something in the printer, but i don't know if that can be achieved with JWS.
One of the things that i don't know if are possible with JWS is, if i can pass data from the web application (a bean because i'm using Seam 2) for example, pass the stream of the print or the stream of the PDF, to the JWS application, and pass the name of the printer, i mean, i just want to have in the JWS app/Applet the logic to print the invoice or ticket, i wanna generate the PDF or stream from my web app, so i don't know if that's possible.
What alternative you consider is the best? JWS or Applets? About the printing library, i read about JAVA POS, but i can use any library, a paid library even if is necessary.
Regards.
What alternative you consider is the best?
For 'least clicks' use a fully trusted applet or JWS app. signed with a digital certificate that has been issued by a CA (e.g. Verisign).
The user will be prompted once to accept the code, and have the option to select the check-box that always remembers the decision to 'always trust'.
Either the JWS app. or applet could then make use of the Java AWT printing API.
As to the choice between embedded applet or free-floating JWS. Use whatever works best for the use-case, but note that applets require higher maintenance.