aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes print all the frames in a page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "print all the frames in a page" Watch "print all the frames in a page" New topic
Author

print all the frames in a page

Tom Chen
Ranch Hand

Joined: Dec 13, 2000
Posts: 46
Can anyone tell me how to:
I've a page with 2 frames. On the top frame, I need a button to print the all page. I tried:
"window.print()"
"parent.window.print()"
"top.print()"
however, all of them only print the top frame. What javascript I should use to print out the whole page including these 2 frames.
Thanks a lot
[ January 22, 2002: Message edited by: Tom Chen ]
[ January 22, 2002: Message edited by: Tom Chen ]

Sun Certified Java Programmer
Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
Hi Tom Chen,
As per I know the printing of frame is a property of the print option. You have to do the setting in your print option to print is as laid on the screen. Through Javascripts you can't control that feature.

Vijay


SCJP, SCJD, SCWCD1.4, IBM486, IBM484, IBM 483, IBM 287, IBM141, IBM Certified Enterprise Developer - WebSphere Studio, V5.0
Author of IBM 287 Simulator Exam
Tom Chen
Ranch Hand

Joined: Dec 13, 2000
Posts: 46
Hi,
I've tried your method. It works. However,Is there other programming way to control that feature. Because User doesn't not accept this mannual way.
The 2nd question, how can I just print the 2nd frame of the page using javascript?
Thanks,
Tom Chen
Originally posted by Vijay Rathore:
Hi Tom Chen,
As per I know the printing of frame is a property of the print option. You have to do the setting in your print option to print is as laid on the screen. Through Javascripts you can't control that feature.

Vijay

[ January 23, 2002: Message edited by: Tom Chen ]
Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
I am handling this issue by adding a print preview button in my frame. As soon as user clicks the button I am building another webpage with all the data in it with a button print and close on the web page or to be more precise the popup. Try this trick.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: print all the frames in a page