I'm trying to use paged.js to generate a separate footer for the last page. The total number of pages is dynamic.
I've tried the named page approach without success as it generates an extra blank page at the end, although it gives the correct final footer at the end.
Can anyone help me?
Currently, Paged.js does not have a selector like
:last
to select the last page.Based on your question, I understand that you want to target thepart of the last page that has content. The named page approach you mentioned doesn't work because named pages rely on the class they are called from, and that class has to be added on an element or section that might be on a different page layout. You need to manually see how long the text is on the last page and put it into adiv
I suspect the only other way at the moment is to generate the book, manually see how many pages there are, and enter the number of pages in thewith a named page class for this to work.
@page :nth()
pseudo-class.
Context:I tried setting up the rule using@page :nth(counter(pages))
, but the counter only seems to work inside curly braces
. This causes paged.js to fail.