Forum How do I...?

Footer doesn't display

martinolsson
I'm trying to insert todays date in the left footer, but it doesn't show. All other headers and footers work. I have the following css:

@page {
size: A4;
margin: 2cm 1cm;
@top-left {
content: flow(header);
}
@bottom-left {
content: flow(footer);
}
@bottom-right {
content: counter(page) ' av ' counter(pages);
font-style: italic;
}
}

#printheader {
flow: static(header);
}

#printfooter {
flow: static(footer);
}

And the following html (roughly)

<div id="printheader">
Header text
</div>

page contents

<div id="printfooter">
<c:set var="theDate" value="<%=new Date() %>"/>
Utskrivet <fmt:formatDate value="${theDate}" pattern="yyyy-MM-dd HH:mm"/>
</div>
mikeday
Is that PHP? Is it being evaluated to HTML before being processed by Prince?
martinolsson
Not php but jsp, and yes it is being evaluated before Prince. I should have cleaned the code up to avoid confusion - it doesn't matter what the #printfooter contains: Prince doesn't "see" it at all.
mikeday
If the footer is at the very end of the document, it may only appear on the last page. You can change this by moving it to the start of the document, or using "flow: static(footer, start)".
martinolsson
Thanks! using flow: static(footer,start) did the trick, but I don't quite understand why.
/Martin

p.s.That minor problem was one of the last things to fix before our new and (very much) improved print feature goes live. Thousands of students and teachers using unikum.net in Sweden will be very happy :-)
mikeday
Flowed content only occurs from the page where it would have occurred if it was not flowed, if that makes sense. So if the footer is at the end of the document, it will not appear from the very first page. The "start" instruction tells Prince to move it back as if it appeared at the beginning of the document. This arrangement is necessary for people that want different headers/footers on different chapters, or sections.