Forum Moderators: coopster

Message Too Old, No Replies

php- print header

         

yllai

1:38 am on Jul 9, 2004 (gmt 0)

10+ Year Member



normally, when we print some thing from browser, we will get the page header on the top of page and the url, page number at the bottom of the page.

in my php page, i want some thing instead of afformation information to be display when printing. How can i do it?

let said i have a list of records that require 5 pages A4 size paper to be print out all, so i want the title of the record to be display at the top of each page and the word "approved by: XXX" and page number to be display at the bottom of each page when print out the reord list. Any idea? How and where i can do it or getting these example?

httpwebwitch

2:26 pm on Jul 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You CAN NOT rely on a browser to produce properly formatted pages for printing. You just can't, so stop trying. Because browsers have varying default font sizes, printers with varying margins, and other user-controlled factors, you will never get your header and footers appearing perfectly at the top of each page in, say, a 4-page document. Even if you tweak and poke and get them looking great when printed from your machine, someone else will get pages with the headers all scattered in the wrong places.

If you are using PHP to produce the pages, output them as PDF files, which will always print exactly as you lay them out (hence why they are so ubiquitous for print).

I suggest you get started with this free code library [fpdf.org], and this tutorial [fpdf.org] concerning headers and footers. Good luck!