Forum How do I...?

@page style not working

jkozar
I am trying to troubleshoot the prince css @page style rules.

I have set up a simple html page with one @page rule here:

http://acgidev.acgisoftware.com/comappagestyle.html

I am also wondering why the margins on everything I print in PrinceXML are so big.

Any ideas?

Thanks in advance :)
mikeday
How about adding a rule like this:
@page { margin: 5mm }
jkozar
That's just it...the @page styles are not working. So setting the margins does nothing.
mikeday
What if you start with a very simple document, like this:
<html>
<head>
<style>
@page {
    background: yellow;
    margin: 5mm
}
</style>
</head>
<body>
<p>How about this?</p>
</body>
</html>
jkozar
mikeday wrote:
What if you start with a very simple document, like this:
<html>
<head>
<style>
@page {
    background: yellow;
    margin: 5mm
}
</style>
</head>
<body>
<p>How about this?</p>
</body>
</html>



That is not much different from the link I provided above. But just to show you:

http://acgidev.acgisoftware.com/comappagestyle2.html

Notice there is no background and a huge margin. (please also see the link in the first post)

Is there anything in our java setup that I should have addressed?
mikeday
It looks like your JavaScript code that tries to grab the document to submit it is mangling the CSS by skipping @page rules. Perhaps styleSheet.rules does not include @page rules?