Technically we don't know when the page break happens and don't have a tool to dynamically react on page breaks.
When this is needed, we typically have to render the template twice, the first time we parse the page and notice where are page breaks. The second time we can render with the aware of page breaks. https://playground.jsreport.net/w/admin/tV6sVKbV