Hi Adriana
There may be a better way, there usually is, but my servlet opens the
printer as a PrintStream . The filename under winnt is lpt or
whatever,since it is an init argument the user can customise. I don't see
any problems doing it this way, except I can't get port signals like
offline etc, but the spooler takes care of that for me.
Here is my snippet.
HttpSession sess = req.getSession(true);
FileOutputStream theFile= new FileOutputStream(Print_Device);
PrintStream ps = new PrintStream(theFile);
ps.println("Order Time: " +(new Date()));
ps.println("Order No: "+sess.getId());
ps.println(comment);
ps.write(0x0C);
ps.flush();
ps.close();
hth
Chris
On Wed, 28 Jun 2000 07:10:27 -0700, Adriana de Faria Ferreira wrote:
>I am trying to print some datas with a servlet, but i can't till now... if
>someone knows how to do it ou print with a applet ou can send me a piece of
>a routine in java, will help me a lot
>
>Thanks,
>Adriana F. Ferreira
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html