我想在Django temp中使用xhtml2pdf只在最后一页显示页脚

2024-09-25 00:30:45 发布

您现在位置:Python中文网/ 问答频道 /正文

如果我删除lastpage关键字,那么它会在所有页面上显示页脚,但是当我添加lastpage关键字时,它不会显示任何页脚

 <style>       
            {% block style %}
               @page lastpage{ ///last page keword line
                    size: {{pagesize}};
                    margin: 1cm;
                    @frame footer {
                        -pdf-frame-content: footerContent; ///footer div
                        bottom: 1cm;
                        margin-left: 1cm;
                        margin-right: 1cm;
                        height: 140px;
                    }
                }
            {%endblock%}
        </style>

    <body>
                    <div id="footerContent">
                <div class="botom">
                        test data
                </div>  
                <div class="agree">
                    I/We certify that our xxx...
                </div>  
            </div>
    </body>

Tags: margindivstylepagebody关键字页面block