File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Printing with JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Printing with JSP" Watch "Printing with JSP" New topic
Author

Printing with JSP

Aaron O'Brien
Ranch Hand

Joined: May 24, 2002
Posts: 89
Hi there,
I have a little program that can print the contents of a canvas. Now, I have decided to implement the same idea into a web page. So when the time comes, I was wondering if it is possible to print the page out at the click of a button (using JSP's of course). I know it's not going to be like a canvas so can anyone lead me in the right direction?
Thanks
Aaron O'Brien


Aaron O'Brien
Nehal Dave
Greenhorn

Joined: Dec 22, 2000
Posts: 28
To print an HTML page without pressing any button can be achived by javascript. The code down in here prints the page after the page is loaded.

Hope this helps u...
CHeers
Nehal. ..
[ August 27, 2002: Message edited by: Nehal Dave ]
[ August 27, 2002: Message edited by: Nehal Dave ]
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
I prefer to associate the print function to a "print button". I guess it is easy to implement, too.
Nehal Dave
Greenhorn

Joined: Dec 22, 2000
Posts: 28
Ruilin
yea he will have to create a button & then on click of button just call window.print() using javascript...
Nehal.
Aaron O'Brien
Ranch Hand

Joined: May 24, 2002
Posts: 89
Thanks guys!
Aaron O'Brien
George Larry
Ranch Hand

Joined: Nov 07, 2001
Posts: 52
Is there a way to make it print out in Landscape (as opposed to portrait)?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printing with JSP