 |
 |
CSS for printing - forcing page break
|
 |
|
 |
|
Junior Member
Join Date: Jun 2003
Location: Bergen, Norway
Status:
Offline
|
|
We're creating a system where we at the end of a registration process need to print two pages of information. This information will be "boxed" (hence - css framing), and will look like a form. However, the amount of information in one or two of the blocks will differ, and we need to make sure which blocks end up on which page, and make sure the print is never more than two sheets of A4 sized paper.
So:
1. Is it possible to use css to enforce box sizes and margins in millimetres instead of pixels?
2. Is it possible to force a page-break when printing?
The system will take the user through a series of registering the required information, and will at the end produce a page where the user is to go through and check for errors, after which he/she would press a "Print and Save" button. After this, the information presented on that page is to be printed onto the pages mentioned above. The layout could be the same, but the best would be to have a specific layout for the print version, and a more suitable layout for the screen presentation.
|
|
Hallvard Opheim
Dual 2GHz G5, 9800Pro, 2.5GB, BT, iSight
PB17 1GHz, 1GB
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
1) Certainly you can use millimeters instead of pixels; just use mm instead of px. CSS actually supports a wide range of measurement units, and although not all of them are useful onscreen, print is another issue.
2) What you want are the page-break-before and/or page-break-after properties. However, I'm not sure how well-supported they are. The latest Safari supports them, and I think Gecko does as well, but I don't know about Opera or IE. On browsers which don't support them, they don't do anything.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Jun 2003
Location: Bergen, Norway
Status:
Offline
|
|
Thanks. As far as my somewhat limited CSS-experience goes, I think you can set media-type in the css, in order to use separate style-sheets for printing and on-screen publishing of data. I'll sit down in the weekend and try to figure this out... Thanks so far!
|
|
Hallvard Opheim
Dual 2GHz G5, 9800Pro, 2.5GB, BT, iSight
PB17 1GHz, 1GB
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by Millennium:
2) What you want are the page-break-before and/or page-break-after properties. However, I'm not sure how well-supported they are. The latest Safari supports them, and I think Gecko does as well, but I don't know about Opera or IE. On browsers which don't support them, they don't do anything.
Just to add on WestCiv has a great resource on this here and a browser compatibility chart here.
Opera has support for everything apparently. NS7 based on Mozilla supports it so you have that. IE 5.5 and 6.0 on Windows supports page breaks and IE 5 for Mac does as well. All those with Safari gets you pretty well covered.
You're only problems would be users with IE 4/5.0 Win and older versions of Netscape which are still somewhat prominent especially with institutions. The good thing about CSS is that it won't adversely affect your page if it isn't supported, it will simply ignore it.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|