Forum How do I...?

How can I avoid "counter(pages)" counting the blank page added to have an even number of pages ?

levure
Hello!

I am using Prince 15.4.1 (trial version) to check if it meets our needs.
Prince is (very) very powerful, very fast, and fully meets our needs, but I have one last issue I haven’t been able to solve.

I need to always have an even number of pages.
So, if the content (which is dynamic) fits on an odd number of pages, I have to add a blank page.

I tried to achieve this by adding:
:root {
    /* Will add an extra page to have an even number of pages */
    break-after: recto;
}

@page:blank
{
    @bottom-center { content: none; }
}


But, the problem is that the total number of pages counter "counter(pages);" counts the blank page.

In other words, a one page letter + the blank page (to get the event number of page) displays a page number "1 of 2", instead of the expected "1 of 1" + a blank page.

Do you have any advice on how to fix this?

Thank you very much in advance!

The complete code (html + CSS included) is attached to this post.
  1. one_page.html8.6 kB
mikeday
Perhaps you could link to content on the last (non-blank) page and then use the target-counter to get the page number of that page instead of using the pages counter?