[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

page-break-after works but I need headers to repeat

Posted on 2009-04-15
6
Medium Priority
?
478 Views
Last Modified: 2012-05-06
I have a div of class type "invoices"...
in my CSS I have: body .invoices { page-break-after: always; }
This creates the needed page break I wanted.

I have some other information which is stored in divs throughout the pages that are broken up. What I need to know is if there is a way to tell the browser to repeat any of this information...on the next page so that the people reviewing the printed form can tell what page goes with what other pages.
0
Comment
Question by:rae_rae
  • 3
  • 3
6 Comments
 
LVL 3

Author Comment

by:rae_rae
ID: 24153318
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup]
"header"="&w&bPage &p of &P"
"footer"="&u&b&d"

[HKEY_USERS\S-1-5-21-3276666647-242206738-1504371609-2193\Software\Microsoft\Internet Explorer\PageSetup]
"header"="&w&bPage &p of &P"
"footer"="&u&b&d"

These are the default values for printing. Maybe it's possible to have the &p of &P reset for sets that belong together? This is just an idea...which may or may not actually be what I'm looking for.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24161530
Hi, rae_rae:  Yes, of course it is possible to tell the browser lots of things in PHP - it just generates HTML statements and the browser renders the HTML.  But it looks like what you posted there is something different, not HTML?
0
 
LVL 3

Author Comment

by:rae_rae
ID: 24161937
You must be referring to my last comment which is simply an idea for our experts to review as a possible solution. I don't know if those registry settings might be edited to accomplish what I want but I'm suspecting not since what I need is dynamic in nature.

And yes, I agree that php has a wide array of capabilities. I've been developing php applications professionally since 2006. I've never had to worry about pagination or repeating header information before though. So, you may know something I don't about this area...which brings me to the site hoping for a solution.

I'll tell you that the data is an invoice and it becomes very crucial to have some of the invoice headers repeat wherever the printer decides to insert a page break.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 24162166
"I'll tell you that the data is an invoice and it becomes very crucial to have some of the invoice headers repeat wherever the printer decides to insert a page break."

The right choice here is to generate the printed version of the invoices in PDF format.  You can use FPDF for that (google it - it's free and easy to set up) and you can control data placement down to something like 1/100 inch.

If you use the browser to print the pages, even with the use of CSS for media=print, you will always be chasing some kind of nuisance or browser-dependent issue.  PDF is a lot less brittle.

HTH, ~Ray
0
 
LVL 3

Author Closing Comment

by:rae_rae
ID: 31570763
Ok Ray, I'll try this solution. I have already gotten fpdf in the system and it's ready. I have never used pdf generation software before but I'm sure with patience I can get it up and running.

Thanks for your insight.
rae_rae
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24167247
Thanks for the points.  Regarding this:

"I'm sure with patience I can get it up and running."

Yes, have patience, at least at first - I found that my success using FPDF was slow at first.  It is almost a "pixel at a time" sort of thing when you start out, but once you get the hang of it, you will be able to charge ahead.  I store PDF files on my server for the client to download and print - it has worked out very well.

Cheers, ~Ray
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question