File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Print functionality 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 functionality" Watch "Print functionality" New topic
Author

Print functionality

sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Hi All,
Thanks a lot in advance.
We are printing some report which might go 2,3,4....pages.Print().
How can we avoid Default header and footer in the print?
And, we have some header and footer for our application how can we repeat this header and footer if page goes more than one.
Please help me.

Thanks and Regards,
Sree
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not remove the default header and footer with JavaScript. That is a browser setting that has to be changed manually. There are activeX controls that can remove it, but that is IE only and your site has to have the right security restrictions for it to work. Probably would be a big headache.

For printing headers and footers on every page. [Guess you are talking about tables] http://lesliefranke.com/2004/09/printing-table-header-footer-with-css/

Eric
sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Thanks a lot for your reply.
I am not talking about table header.
Header of the page. For example there are three frames/Tiles Frame 1 will contains my header like logo and some images tobe shown on all pages and same Frame3 footer.
And Frame/Tile2 is actual contenet.
I think now your clear with what Iam required.

Thanks and Regards
Sree
Shawn Montague
Greenhorn

Joined: Aug 06, 2008
Posts: 25
You should look into how to manage printing with CSS. You can set up two CSS files, one included on web and another when printing. During printing, you have a class in the CSS that sets your header and footer tables to "display:none;" or "visibility:none;" (one of those will work better than the other, can't remember which right now).

We used this at my last job for allowing printing of reports off client websites and it worked great.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Do research with CSS Print Media

Eric
sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Thanks a lot for your replys.
With this can we remove default header and footer of print.
i.e., Url and date in the bottom . page number at the top.

Thanks & Regards
Sree
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
No, that's under the control of the browser, not of the web page. I think some browsers -but not all- let the user configure that, but there's nothing you can do on the web page to affect it.


Ping & DNS - my free Android networking tools app
sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Thanks a lot for your reply.
Atlease can we repeat Header and footer of our page if conetent of the page is going beyond one page.
I want Header and footer should be displayed in all the pages.
These header actual my page header not table headers.

waiting for reply...

Regards,
Sree
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Print functionality