Forum How do I...?

Invoke @page with a selector

afingret
I have a dynamic application where I am trying to create a one-to-one relationship between screen and paged versions (well... as much as possible). The application can have different page sizes and orientations, and currently adds classes to the body, such as:

body.landscape OR body.portrait

Is there any way to invoke @page with class selectors so that Prince can read these selectors when it goes to make the PDF? What I would like is something like this:

body.landscape {
@page size: landscape;
}

OR

body.portrait {
@page size: portrait;
}

I know that this is terrible syntax, but hopefully you get the idea. Is there any way to achieve this without dynamically adding extraneous css links to the html head?
mikeday
Named page can do this:
@page landscape {
    size: landscape
}

body.landscape {
    page: landscape
}
afingret
That totally works. Thanks!