Forum How do I...?

Extra page if odd number of pages

ollih
Hi,

is there a way to add an extra page to the pdf if the document has odd number of pages? Or show/hide the last page with css based on page count?
mikeday
You can add this at the end of your document:
<div style="page-break-after: right">
</div>

Edit: or just apply this style to the body element? Might be simpler! :)

Edited by mikeday

ollih
What about if I want the page to have some content?
mikeday
That gets tricky if you only want that content to be shown when the document would otherwise have an odd number of pages. You can use the @page:blank selector and put things in the margin boxes, that's about it.