Jump to content

Printer Friendly w/ footers on each page


Stooney

Recommended Posts

Say I need to print a 5 page document.  The data on the document is dynamic (entered by a user) and will vary in size.  At the bottom of every page, there needs to be a footer.  How would I put all this together to where the data is cut off near the bottom of every page for a footer, and then continued onto a next page? 

 

    paragraph 1..............
...................................
...................................
                                              Page 1
  paragraph 2................
...................................
...................................
         ---Footer--
___________________________________
paragraph 2 continued...
..................................
                                              Page 2
  paragraph 3...............
..................................


         --Footer--
___________________________________

Link to comment
https://forums.phpfreaks.com/topic/235578-printer-friendly-w-footers-on-each-page/
Share on other sites

have a look here: http://www.javascriptkit.com/dhtmltutors/pagebreak.shtml

 

keyword is page break.

 

Also in case you were not aware, you can make a special stylesheet for printing purposes.

hope this helps in a way.

That's fantastic.  I'm surprised I didn't find this via Google last night.  Thank You.

 

One last hurdle now, any suggestions on how would go about determining where to insert page breaks dynamically?  Like is there a way to measure how much of a page X text with take up so I can insert the page break in the middle of a paragraph if necessary to leave room for the footer?  This might be more of a javascript question though.

well I never tried that, but i bet both php and javascript have something that can see what the string length is and do something with that info. for php.

 

for php strlen() could be something to have a look in: http://www.php.net/manual/en/function.strlen.php

 

than make some sort of if clause, if strlen() is 1000 insert a pagebreak. just a brainfart, but that's how i would think when searching.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.