Link to home
Start Free TrialLog in
Avatar of tomhoran
tomhoran

asked on

Print Page Break - HTML Page Break

Is there a way to put a character within HTML so when someone prints the HTML form/screen I can force a page break. I want to develop a new HTML form/screen for an employee to fill out, and when they print it the screen/form prints two separate pages. I want to be able to control where the 2nd page starts.
ASKER CERTIFIED SOLUTION
Avatar of RichieHindle
RichieHindle

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tomhoran
tomhoran

ASKER

That's eay .. will that work in both IE and netscape .. anothers all browsers ?
I tested it in IE6 and Firefox 1.0PR on XP.  I don't have older versions to try it with, but I'd be very surprised if it didn't work in IE5+ and Netscape 6+.
I had a hard time getting those CSS properties to work and ended up using a PDF component to have ultimate control.  ABCPDF (abcpdf.com) can be used free if you link back to their site.  If you pay for a component, I like ASPPDF (asppdf.com).
nan1217: Can you elaborate on 'a hard time'? Did you find that older browsers didn't support them, or were buggy, or that the properties didn't work with your content...?
The properties didn't work for me.

Here's an example of someone else using these properties in a PAQ.  https://www.experts-exchange.com/questions/21118256/Page-break-before-Page-Break-After-Pulls-the-page-down-when-printing-Why.html
What I do is pick a tag where you want the page to break. In this example I used the  H3 tag

In the header add this line

<STYLE>H3 { PAGE-BREAK-BEFORE: always }</STYLE>

Wherever the <H3> is in the body of your page it will produce a page break.

In order to test it, use IE 5+ and try the Print Preview. You should be able to see if it works on screen.