简体   繁体   中英

need xhtml2pdf (Pisa 3.0) css syntax for @page and @frame

i'm trying stuff out with xhtml2pdf (aka Pisa 3.0) and django and am having trouble with the css
http://www.xhtml2pdf.com/doc/pisa-en.html
obviously the docs above talk about the css that is available as well as vendor specific tags.

If i follow the example in the docs for static frames and make css like

@page{
        margin:0cm;
        @frame header{
            -pdf-frame-content: header;
            height: 3cm;    
        }
        @frame footer{
            -pdf-frame-content: footer;
            bottom: 2cm;
            height: 2cm;
        }
    }

    .main_content{
        padding: 0px
    }
    #header{

        background-color: #02164c;
        font: #FFFFFF;
        width:100%;     
    }
    #footer{    
        width: 100%;            
    }
    .pageBreak{
        page-break-after: always;       
    }

I get an error in django

Exception Value:

Ruleset opening '{' not found:: (u'@page{\\n\\t\\tmargin:', u'0cm;\\n\\t\\t@frame header')

Exception Location: /usr/lib/pymodules/python2.6/sx/w3c/cssParser.py in _parseAtPage, line 654

it looks like the css parser is croaking on @page.
To me it looks like i'm using it as in the examples. I'm hoping someone can help provide some guidance on this or point me to some template examples.
I also am wondering how to use the -pdf- vendor specific tags. there is no documentation on these tags that i can find...

@page{似乎在{更改为@page {之前没有空格时导致错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM