When creating a VisualForce page that is intended for output as PDF, it would be extremely useful to be able to set some component of HTML/CSS/Image or other formatting to be a 'header' or 'footer' that would appear on every page of the rendered PDF.
For example, if you are creating an Invoice document in Visualforce, and the document spans to multiple pages, you may want to put the Invoice # or other data from Salesforce at the top of every page.
Similarly, if you are outputting a report format via PDF, it would be great to have the column headers from a dataTable or similar tag repeated on each page.
Currently, there is no great way to identify when and where a dynamic set of data will split into a new page. Although the CSS @page functionality helps, it does not appear to be fully implemented to point of being able to flow content into a div or other format-able structure. Perhaps an Apex <pageheader> and <pagefooter> tag that would apply for PDF rendering would be the best option.
4 Comments » Posted by gireeshz
Posted Jul 15
Categories: Apex and Visualforce, Force.com Platform
|
ncurham Jul 30 |
Please, do this ! I've got a lot of templates to transform to PDF with headers and footers ; and still having the problem with the header and footer position. This is very important !! |
|
pankaj_agrawal Jul 30 |
we have several VisualForce pages for PDF and they need header and footers. |
|
volkersf42 Oct 21 |
We also would like to use this feature... We can't have footers in HTML! |
|
kirk_fretwell Nov 21 |
Specifically, please implement "page based floats" (section 7 of this W3C candidate recommendation document): http://www.w3.org/TR/2004/CR-css3-page-20040225/#top-bottom-floats |