• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Marshal
Posts: 28226
95
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic