0

I have found many older suggestions and solutions, none of which work as expected and many that just cause more issues.

Assume my web app allows users to create invoices and print them. These invoices may have any number of line items (even 100 or more). If the number of line items exceeds the page size, they are placed on the second page. This is fine.

What isn't fine is that if the second page should ever become separated from the first, it can get hard to tell which invoice it belongs to.

Is it at all possible (css, js, html, hacks, etc) to have a block of content repeat at the beginning of each and every paper page printed from a web page?

The linked possible duplicate question is from a few years ago and has no accepted answer, while the top answer doesn't actually work (as shown in the comments)

Glen Despaux Jr
  • 1,064
  • 7
  • 19
  • 1
    possible duplicate of [How to use HTML to print header and footer on every printed page?](http://stackoverflow.com/questions/1360869/how-to-use-html-to-print-header-and-footer-on-every-printed-page) – Dave Jul 14 '15 at 20:08
  • 1
    According to the comments, that doesn't work in chrome. What about this:https://stackoverflow.com/questions/19646835/print-repeating-page-headers-in-chrome – Florian Wendelborn Jul 14 '15 at 20:08
  • I've indeed tried the suggestions in that link, however none of them work. The closest one was the fixed position, which placed the info _behind_ the other text and didn't print on the actual paper. – Glen Despaux Jr Jul 14 '15 at 20:59

2 Answers2

0

If at all possible create a PHP module and put it on every page inside of your web app. I've had to do this a few times.

If you want it to have an invoice number you can script it to start at 1001 and go up every time a function is completed. (A print button is selected)

0

May I suggest using page-break-after:. With page break you can control wherethe page breaks then re-insert headers.

user3669714
  • 90
  • 1
  • 1
  • 8