• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print out file from the web?

 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I must build an web application which has print function ( through Printer) a form with data get from the database.
I don't know how to do
Please guide me!
Thanks a lot!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Printing on the server or the client?
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Website has this function, and user can use it (he must have his own printer)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want the user to be able to print out the current html page? or something else? A PDF perhaps?

Please include more details so we don't have to keep asking you these questions.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are probably looking for window.print() JS function.
Call this JS function on 'on click' event of Print button:

 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the inconvenience!
I have a form (html/jsp), and Print button. When user clicks this button, this form will be printed out , just like you print a word file
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JavaScript forum as you'll need to use JavaScript for this.
 
Kavin Ge
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you find another way to do this except using javascript function ??
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kavin Ge wrote:did you find another way to do this except using javascript function ??

Write a message out telling the user to choose File --> Print? You need JavaScript to do anything dynamic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic