Change breakToken on lastPage
Hi,
I want programmatically push some content of a page to the next one. The content is generated dynamically so I have to use afterPageLayout hook.
To push the content to the next page by changing the given breakToken and removing the pushed content from the current pageElement works - except for the very last page. In this case the breakToken is undefined and changing the variable will not cause a new next page.
afterPageLayout(pageElement, page, breakToken, chunker) {
...
// Will not push content and therefore no creation of a new page when it is currently the final page
breakToken = node;
}
How do I achieve this on the (currently) very last page? Are there better ways to push content or continue rendering on the next page?
// I would wish to have something like
afterPageLayout(pageElement, page, breakToken, chunker) {
...
chunker.startNextPageWithGivenToken(node: Node, removeContentFromNodeToPageElementEndToPreventDuplicatedContent: Boolean)
}