PDA

View Full Version : text is cut off on the right when printing


valeria_vi
09-11-2002, 11:08 PM
how to avoid that? is the only way to reduce the horizontal space the content occupies on a page???

MCookie
09-11-2002, 11:38 PM
Val, on Mac, in IE, choosing "Print page" or "Print preview", I can choose between

Shrink page to fit
Crop wide pages
Print wide pages

Maybe your prefs are set to "Crop wide pages"?

valeria_vi
09-11-2002, 11:51 PM
MCookie,
i probably did not frase my ? right. What can a web developer do so that the pages of the site are not cut off on the rigth when printed.

JustAsking
09-12-2002, 01:54 AM
If the text is beign cut-off when printed, as you originally said, you should put everything in a table. The table can either be set as a percentage of the window's horizontal width (e.g. width="100%") or as a fixed pixel value (e.g. width="600"). If you use fixed pixel value make sure the width of the table fits on a standard A4 size paper when printed portrait. This is the olny reason I can think of as to why text is cut-off.

Hope this is some help.:thumbsup:

MCookie
09-12-2002, 07:06 AM
You could also write another stylesheet to change sizes and fonts etc.

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

So when someone prints your page it looks like you want it to look on paper.

valeria_vi
09-12-2002, 10:33 PM
MCookie,

that sounded like an ideal solution, but when i lined the stylesheet, it did nothing. i have doublechecked that the files name and link are correct. i also tried changing the font in teh "for print" stylesheet, so that tha change will be obvious when printed, but ... nothing changed.

what could be the problem?

MCookie
09-12-2002, 11:21 PM
Val, it should work in every 5+ browser like this: your media="all" stylesheet (see below) is the default stylesheet. The style you declare in there is always there. In the print.css stylesheet you only have to put the style you want to change.
For example, if style.css contains

p {
font-family:verdana;
font-size:12px;
color:#000;
}

but you only want another font on paper, print.css only has to contain:

p {
font-family:"comic sans ms";
}

Font size and color will be the same.
So, since print.css has to override the default style, put the links to your stylesheets on your page in this order:

<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<link rel="stylesheet" type="text/css" media="print" href="print.css" />

joh6nn
09-13-2002, 12:55 AM
as i understand it, if you have two conflicting style sheets, they're supposed to be merged, BUT, lots of browsers haven't quite gotten this down, yet, and even the ones that have, seem not to be able to decide what the rules for merging are, which means that frequently, one style sheet just cancels the other out.

so, putting a MEDIA="ALL" attribute, and putting a MEDIA="PRINT" attribute, one of them's gonna get canceled out, and in this case, i'm thinking that the Print one gets canceled out. try MEDIA="SCREEN" and MEDIA="PRINT", respectively; in theory, that keeps them from fighting with each other.

valeria_vi
09-13-2002, 03:41 PM
MCookie,
when i followed john's advice to have meadi="print" and media="screen", teh font style was being applied to the printed page, but if i only left the font-family, removing font-size from teh "for print" stylesheet, teh text was coming out enormous size - not the way i hvae it on the site. it seems liek font size declaration is nessesary.

MCookie
09-13-2002, 04:35 PM
Then maybe it's best to leave out the media attribute from main stylesheet.
Don't know if it's important for you, but NN4 only understands media="all", so NN4 users won't see any style at all.

valeria_vi
09-13-2002, 09:32 PM
MCookie,
yep, I've already figured that out, but decided I don't care that their table will go all the way to the right.


THANKS EVERYBODY!