Even pages
Hi, I want to create a pdf with even pages. If the content results in 2, 4, ... pages everthing is fine. But if the content results in 1, 3, ... pages a blank page should be inserted as last page.
How do I achieve that, I tried the following:
// works only between content
break-after: right;
// will add wished blank page to result in even pages
afterPageLayout(pageElement, page, initialBreakToken, chunker) {
if (!hasInitialBreakToken && page.blank === undefined && chunker.total % 2 !== 0 && page.endToken === undefined) {
// Add blank page
chunker.addPage(true);
}
}
The latter works but I would prefer a CSS based solution or maybe someone has a better idea?
Sidenote: the content will also be changed dynamically but the CSS are evaluated beforehand?