views:

40

answers:

1

I have a web form with a number of text areas on it. The length of these text areas can expand if large amounts of text are added. In other areas you can add and remove certain form elements.

This means that the form length can vary a great deal. The users would like the ability to see when writing the form where the page breaks would appear when printing it and if necessary insert their own page breaks into the form to ensure that it prints correctly.

Is there a way I can tell where the browser is going to insert page breaks when it prints whilst the user is completing the form so that I can give them a visual pointer (horizontal rule or similar) showing where the break will occur?

I'm working in ASP.Net / C# 3.5. I realise the above might not be easy since consistent printing in the browser using HTML is difficult. If it is impossible could I convert to PDF or XPS when printing and calculate where the page breaks would be once converted whilst the user completes the form?

A: 

Hello,

This should not be ASP.Net specific.

For printing simply specify a CSS PageBreak using page-break-before or page-break-after.

kervin
That's not what I'm asking though, I want to know where the page is going to break when printing first and to show the users that and then allow them to insert page breaks if they want it to break in another location.
colethecoder
I am thinking that you can use CSS and Javascript to insert a div bottom border to identify the bottom of the page and also add a page-break-after on that div tag. It will never be an exact science, but I think that should get you close if you use a conservative page size.
kervin