Forum How do I...?

Page Break with a blank page

lhornaday
For duplex printing, I need blank page inserted before each chapter if it doesn't start on a 'right' page.

I am using the following code, but I need the 'pages' counter not to count the blank page.

h1 { page-break-before: right; }

@page:blank {
    @top{
        content: normal;
    }
    @bottom {
        content: normal;
    }
}


My output is "Page 7 of 8" but there are really only 7 pages excluding the blank one.

Thanks in advance.

Edited by lhornaday

mikeday
That's tricky, in fact I'm not sure if that's currently possible, I will investigate.
lhornaday
Thanks, for checking. I couldn't solve it for myself but got close. I've dropped the page numbers.

Others may try a solution using a hidden element appended to the end of the content. Then use a target-counter to find and display the page number it is on. This would be done instead of using "counter(pages)".
mikeday
Ah you could do this with a JavaScript function called from the CSS generated content that takes counter(pages) and subtracts the number of chapters! Slightly messy to arrange, though.