hi, can I have the facility of printing documents from Servlets? I need to provide a PRINT option in HTMl pages generated from servlet? How do I go about doing this? plz guide me thnaking u in advance, cheers Aman
An IDE is no substitute for an Intelligent Developer.
Joined: May 11, 2001
I see you know the print package very well, so please can you e-mail some simple code or plain Instructions how to print a plain java/swing component, since I can't get it working, It will be very helpfull, firstname.lastname@example.org
Hi Aman, Can you mail to me how I can print through the servlets on the client side, if possible are there any other ways to do. I am trying to generate reports that should be printer on the client who will press a button like Print Report on his machine on clicking the button a servlet is invoked that will get the data from the database and it should throw it in a formatted format on the client's printer. thanks, p ramesh babu maimailto:Prameshb@hydbad.tcs.co.in
Still servlet runs at server, and can access network printers connected to it. But you can't print on specific client printer. If you can do that, that over rides simple web security principle. In web client should initiate the action, and authorise use any local resources. Just selecting a file won't give you that permission. Any way check it. Even I am interested. if you succeed post your solution here. bye. regards. Raghavendra Holla.
Joined: May 11, 2001
Hi, Thanking u'll again for all replies and queries. I'm still in development stage of the code to print files to the printer. The sooner I'm thr' with it, I shall publish it here! Currently i'm encountering an error while drawing the contents of file to be printed to the graphics object using drawString (). Calling this function, crashes the HotSpot Virtual Machine. Working 'round for a feasible solution, shall keep u updated. I guess the problem is using post-script printer drivers or with data-format sent to the printer - not sure yet! Raghavendra, as u rightly said that i cannot access/print to clients printer using servlets, but i need this option in my intranet/interner site which will be accessible to just ONE SINGLE USER! cheers Aman