Forum How do I...?

Add text to blank pages.

min.han
I was trying to figure out how to add the text "Page Intentionally Left Blank" to blank pages.

@page:blank {
content: "Page Intentionally Left Blank"
}

doesn't seem to yield the results I want. I know it can be placed in @top and @bottom, it's just that I have headers and footers that I want on blank pages.
mikeday
This is surprisingly non-obvious, especially if both @top and @bottom are in use. We may need to add another page region to support this. In the meantime, there is a sneaky workaround using an SVG background image to hold the message:
@page:blank {
    background: url("blank.svg") no-repeat center;
}

With the external blank.svg looking something like this:
<svg width="10cm" height="5cm" xmlns="http://www.w3.org/2000/svg">
<text x="5cm" y="2.5cm" text-anchor="middle" font-size="12pt">
    This page intentionally left blank
</text>
</svg>
min.han
Wow thanks, that worked. You're right, that is a non-obvious solution.
csawjer
There seems to be an other way: Add an empty div in the html. This added for me an empty page from and empty div at the end of the text. I do not know if it would also add an empty page somewhere in the middle.
sfinktah
This quick hack of mikeday's answer [surprisingly] works:

@page :blank
{
   	background: url(data:image/svg+xml,<svg%20width%3D"10cm"%20height%3D"5cm"%20xmlns%3D"http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg"><text%20x%3D"5cm"%20y%3D"2.5cm"%20text-anchor%3D"middle"%20font-size%3D"12pt">This%20page%20intentionally%20left%20blank<%2Ftext><%2Fsvg>) no-repeat center;
}

Edited by sfinktah