Replicated with web demo conversion.
To get expected result please uncomment background-color rule from css.
Shortly it should produce 4 pages of "empty header" with black line in practice. However if no background-color is not defined only single element/page will be rendered.
Code: HTML/ASPX
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
.container {
height: 50px;
border-bottom: 2px solid black;
/*background-color: #fff; UCOMMENT TO WORK-AROUND*/
page-break-after: always;
}
</style>
</head>
<body>
<div class="container"></div>
<div class="container"></div>
<div class="container"></div>
<div class="container"></div>
</body>
</html>
Edit: Part B
In some other cases even that workaround is not enough. If user wants to add header for example pages: 2 and 4 I can generate example html like this:
Code: HTML/ASPX
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
.container {
height: 50px;
background-color: #fff;
page-break-after: always;
}
</style>
</head>
<body>
<div class="container"></div>
<div class="container">a</div>
<div class="container"></div>
<div class="container">b</div>
<div class="container"></div>
</body>
</html>
But empty pages are now dropped from start and from the end so that "a" is on page 1, "b" is on page 3 and there is total of pages 3 instead of 5. How ever this middle page is rendered "correctly".
So: how to _RELIABLY_ wrap content to specific pages without doing per page rendering (which is unacceptable slow)? Well inserting always something like <span style="color:white;">.</span> works...
Currently this feels like that you are doing enormous work to heuristically guess what I am doing and "fix" my content while I trying to guess your heuristic and invent tricks to prevent you doing so. So it more like fighting against each other rather than working together what it should be. I understand place of these 'corrections' but could there be at least some opt-out mechanism?