Jump to content

Printer Friendly w/ footers on each page


Stooney
 Share

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
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.