[SalesForce] Visualforce PDF : how to display footer on ALL pages

I have read a lot of topic about pdf footers but nothing allows me to add my footer on ALL my pages :

<apex:page standardController="Opportunity" extensions="FicheSocieteController" showHeader="false" sidebar="false" standardStylesheets="false" renderAs="pdf" applyBodyTag="false" applyHtmlTag="false">
<head>
    <style type="text/css" media="print">
        @page {
            margin-bottom: 3cm;

            @bottom-center {
             content: element(footer);
            }
        }

        div.footer {
            display: block;
            padding: 10px;
            position: running(footer);
        }

    </style>
</head>
<body>
    <!--some elements-->
    <div class="footer" name="footer">
        <!--my footer-->
    </div>
</body>

The footer is display only at my second page if have 2 pages (if I have a lot of text in the page)
If I have only one page the footer is displayed correctly, but I'd like to display it in all the pages

Best Answer

I finally resolve my problem by putting the <div class="footer"><some footer here</div> BEFORE the content of my page. This way I can see the footer on all the pages. If any of you know why this is acting this way, I'd like to hear it :)

Related Topic