// Note: For now, we limit both the header and footer to a single physical
// page. This safes me a lot of trouble for now.
// we have to iterate using a more complex schema here.
// Step one: layout the header-section. Record that height.
final PageAreaRenderBox headerArea = pageBox.getHeaderArea();
headerHeight = headerArea.getHeight();
headerArea.setHeight(headerHeight);
// Step two: The footer. For the footer, we have to traverse the whole
// thing backwards. Nonetheless, we've got the height.
final PageAreaRenderBox footerArea = pageBox.getFooterArea();
footerHeight = footerArea.getHeight();
footerArea.setHeight(footerHeight);
// Step three: Perform the breaks. Make sure that at least one
// line of the normal-flow content can be processed.
// Reduce the footer and if that's not sufficient the header as well.
final long[] originalBreaks = pageBox.getPhysicalBreaks(RenderNode.VERTICAL_AXIS);