Forum How do I...?

Make blank pages really blank

luiz_borges
I have the following CSS:
div.ChapterBlock { page: chapterPage; }

@page chapterPage:left { @bottom-left { content: counter(page); } }
@page chapterPage:right { @bottom-right { content: counter(page); } }

div.TitleBlock+div.ChapterBlock { counter-reset: page 1; }

.TitleBlock { page-break-after: right; }

.ChapterBlock { page-break-before: right; }

The XHTML looks like:
<div class="TitleBlock">...</div>
<div class="ChapterBlock">...</div>
<div class="ChapterBlock">...</div>

I want the final PDF to have all ChapterBlocks starting at a right (odd) page. But if the page before the ChapterBlock is blank (if the previous ChapterBlock or TitleBlock ended on a right page) I don't want any footer to be shown. Right now, the "blank" page uses the formating from the chapterPage:left, how can I prevent that and make my blank pages between chapters really blank?
mikeday
You can use a "@page:blank { ... }" rule to suppress the footers on blank pages.
luiz_borges
But for that I would have to manually add a blank page, and that is not always the case. If the last chapter ended on an even page, the next one will begin on the odd page with no blank page inbetween.
The main problem here is not so much the blank pages inbetween chapters. The biggest problem is the page in between the summary (that can span many pages) and first chapter.

As you can see I reseted the page counter on the first chapter and now, because of that problem, the second page (which is supposed to be blank) now shows a number 2 on its footer, which is then followed by the first chapter page numbered 1...
mikeday
Okay, I'm a bit confused. What exactly is the problem? :)
luiz_borges
This is a 3-page document.
<html>
<head>
<style type="text/css">
@page chapterPage { @top { content: counter(page); } }
div.Chapter { page: chapterPage; }
</style>
</head>
<body>
<div style="page-break-after: right;"><p>Summary</p></div>
<div class="Chapter">This is a chapter.</div>
</body>
</html>

Expected: only page 3 should be numbered.
Result: numbering starts on page 2.

Logic:
The numbering should appear only on the chapterPage's.
Since I have a page break after the summary to the next right page (page 3), the chapter should begin after that, therefore the numbering should also begin after that (page 3).

In Prince the style for @top (and @bottom, etc) "leaks" to the previous page if there was page-break, even if the page-break happened in an element that that doesn't have this style (the summary in this case).
mikeday
Right, you can work around this by overriding the header on blank pages with this rule:
@page chapterPage:blank { @top { content: none } }
luiz_borges
That is exactly what i need, I didn't know this ":blank" selector existed.

BTW: Where in the documentation is this :blank selector, and also, what other selectors beside: :left, :right, :first and :blank exists?

Thanks.