Topic: Success of controling paged media with CSS??? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10938" title="Pages that link to Topic: Success of controling paged media with CSS??? (Page 1 of 1)" rel="nofollow" >Topic: Success of controling paged media with CSS??? <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 03-16-2003 19:57

Has anyone had much success with controlling the paged media? I am able to control font, tables, anchor tags and so on... but I really need to have more control over the paged media: specifically the margins. No matter what I do, I'm not able to get the margins to change. I need a smaller margin... I've tried this, but to no prevail:

@page {
margin: 1cm;
}
body {margin:0px;}

Thanks for anyhelp. Karl
PS: using IE 6.0 +



karl@laketahoegymnasticscamp.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-16-2003 23:24

It looks like you have your syntax right and everything. 10 bucks says Internet Explorer simply doesn't support it.

Perhaps you could achieve the same effect by using @media print { body { margin:1cm } }? Not sure if that would have the same effect in all situations.

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 03-17-2003 18:24

edit: Better yet, here's a more definitive source.

[This message has been edited by Perfect Thunder (edited 03-17-2003).]

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 03-18-2003 01:12

According to RichInStyle, almost none of the paged media attributes are supported in most of the older browsers. The table only shows support up to NN4, Mozilla 5, IE 5 and Op 3.6, so I'm not sure about the latest browsers. Most CSS support tables don't even bother showing paged media attributes, though, so I think it's pretty safe to say that the support is not very good (if there is any support at all).

Such is the gap between the ideal and reality that we must all struggle with... *sigh*

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 03-18-2003 01:31

CSS support info at WestCiv.com -- more up-to-date than the RichInStyle stuff.

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 03-18-2003 06:21

It's really a confusion of terms that isn't defined fully in the CSS 2 Specification. @page does not mean "a piece of paper from a printer".

The only place I find a real definition of @page is in the W3C CSS Mobile Profile 1.0, http://www.w3.org/TR/css-mobile#section-selectors

quote:
@page "Defines a (optionally named) page formatting context"



So what? Well there are five paged media types: embossed, handheld, print, projection and TV. Think: media type = device.

@page rules by themselves to not tell the browser which of the five paged media types (devices) the rule applies to. It merely tells the browser to use the page box model instead of the usual box model and gives it some properties of that page box. In other words, a page formatting context.

It needs to be tied to a media type (device), in this case, media="print" in order for the browser to make sense of it. Therefore, you need a separate style block for the CSS that apply specifically to printed media, and your @page rule goes within it.

Or you can use Slime's method above within a style block for another media type (or within a media="all" block) to say, "Oh, by the way, use this rule instead when you print."

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 03-18-2003 07:34

PT: Ah, yup--that's the one I was looking for. And that chart says that it's only supported in Opera 5(!).

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-18-2003 14:23

Karl: I'm wondering what you are trying to do? It may be that there is a simpler way of doing what you want. Why do you need such tight control over things? If that were the case you might want to think about using PDFs or something.

___________________
Emps

FAQs: Emperor

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 04-01-2003 21:43

Emps:

Trying to get the most out of a piece of paper... trying to squeeze the margins down to their "mins". At my site (example link below) their are reports that a user can view online, and then an optional "printer friendly" (see "printer friendly" under mso tools on left) page to print from.
Hey, If I could create a PDF on the fly, that would be cool. I'm using XSLT to transform my data. Can you create a PDF on the fly using XSLT?

Karl

Example Link: http://www.meetscoresonline.com/results.asp?ax=9&meetid=10009&tm=Sunrays



karl@laketahoegymnasticscamp.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-01-2003 22:33

I believe, if you transform into XSL:FO, there are programs that convert that into PDF files. I'm not sure what programs do it though, and XSL:FO is pretty complicated. You may want to just try to find a CSS workaround first.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu