aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to add header and footer to dynamically generated page for print 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 "How to add header and footer to dynamically generated page for print" Watch "How to add header and footer to dynamically generated page for print" New topic
Author

How to add header and footer to dynamically generated page for print

amitava guha
Greenhorn

Joined: Jul 30, 2009
Posts: 7
Hi,

I am trying to create an application print page. The content of the application is dynamic, for example you can add multiple addresses or personal details. So the page lengths are not static. I need to place a header with application number and footer with page number in page x of y format. How can I place the header and footer dynamically?

Any help will be appreciated.

Regards,
Amit
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41525
    
  53
Is this for a web app or a desktop app?


Ping & DNS - my free Android networking tools app
amitava guha
Greenhorn

Joined: Jul 30, 2009
Posts: 7
This is for a web application. I am using JSP pages with Struts framework in J2EE.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well the printer already puts page X of Y on the page. Not sure why you need to repeat that.

To do it with html/css, it will only really work with browsers that support CSS3 which is not that many.

It normally is better to create a pdf file on the server and make it look pretty that way.

Eric
amitava guha
Greenhorn

Joined: Jul 30, 2009
Posts: 7
Hi
Thanks for reply,
Well a PDF file would have been a better choice, but we started with assumption of giving a simple html print only.
The page X Of Y can be resolved by setting [&p Of &P] in the print setup. But still we need to give a header which is a number generated in the code.

Any solution?
amitava guha
Greenhorn

Joined: Jul 30, 2009
Posts: 7
No solution?
 
jQuery in Action, 2nd edition
 
subject: How to add header and footer to dynamically generated page for print