1

I'm trying to create a report which is showing tabular data. Whenever a page limit is reached (standard 8.5x11 paper) I need insert a page header for the next page (each page needs it's own header, the tabular data can't simply spill over without one), and then continue printing the tabular data.

Is there an easy way to do this? I would need the same thing for footers to just show page numbers. This is a small in-house company project, so it would only need to work in Chrome.

Hoser
  • 4,974
  • 9
  • 45
  • 66
  • Please check this [http://stackoverflow.com/questions/1360869/html-print-header-footer](http://stackoverflow.com/questions/1360869/html-print-header-footer) – Mamuz Sep 23 '13 at 19:44
  • Thank you. However, this only seems to add the footer to the first page. The subsequent pages are without the footer. Any idea why? – Hoser Sep 23 '13 at 19:48
  • Actually that solution works for Mozilla, not Chrome – Hoser Sep 23 '13 at 19:56

1 Answers1

2

HTML/CSS don't support printing Header/Footer as standard.

I think a good practice is to use a third party library to generate PDF-Documents.

A good one is TCPDF (open-source). It can convert HTML to generate a PDF-File server side.

Here is an example for a simple Header/Footer Layout, and here is the PHP-Code for this.

Mamuz
  • 1,730
  • 12
  • 14