• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Printing a server file to client side printer

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Shruti Gongle
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone tell me how to print a server side file on the client side without displaying it on the client side browser???
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic