Help!!! I want to print a file which is on my server to a printer on client side.I wrote a servlet for it...but the page got printed on the server side.Does anyone know how to do this.... I hope this does not sound a stupid query...
What you have here isn't really a JSP-question. I suggest that you display the file in the browser (on the client) and have the user press file -> print, or supply some "print" button using javascript, do a search on "print" on javascript.internet.com, I tried and got 45 hits.
Shruti Gongle
Greenhorn
Joined: Jun 27, 2001
Posts: 8
posted
0
Thanks much Peter for your prompt response.The solution u have given is right but my case is a bit different. To tell the details...i am fiddling with Jasper Reports . Its a very good tool for report generation using java. U can create PDF/XML reports and aslo u can create a file which is in ready to print format. So on my web page i want to give the users an option to directly print a file. As it is if i show the user the PDF file he can directly print the report. But i wanna try out direct print....have u done any thing of this sort???
If at all it is printing on the browser then obviously the report will appear on the browser, It's COM. If this is the case then the javascript //This can make automatically print a doc on the client side; //Never tried but can you insert this HTML in the output which is pdf? <script type="text/javascript"> if(window.print) window.print() else alert("no printer found"); </script> may be of no use; as the pdf is a independent component embedded on HTML, if at all we try using javascript then it cannot completely print the document as it will just print the window I Guess...Never tried...
s.r.k.reddy<br />Good Luck.
Shruti Gongle
Greenhorn
Joined: Jun 27, 2001
Posts: 8
posted
0
Can anyone tell me how to print a server side file on the client side without displaying it on the client side browser???
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Printing a server file to client side printer