• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Printing through a web application

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a web based application. Through this application, when the user clicks a print button on the screen it should generate a pdf file and store it on the server side and also fire a print command on a printer on the client side.
How can I do this through Java ?
since the file is created on the server side and the JSP is on the server side I do not know how to pint it on the client side ?
Any ideas would be appreciated.

thanks,
gayatri
 
Sheriff
Posts: 28362
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fortunately, from your web application you can't cause something to print on the client's printer. It's bad enough that certain websites pop up advertising windows all over the place, imagine if they could print ads on your printer!

What you should do is send the PDF data as a response in the standard way. If done right, this will open Adobe Acrobat on the client's system with the PDF loaded into it. There's a "print" button in Acrobat which the person at the client's system can use if they want to print the document.

That also means the button shouldn't say "Print". It should say something like "Download" instead.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Paul.
 
Let's go to the waterfront with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic