// while there is still stuff in the flow, ask the
// layoutMasterSet for a new page
// page number is 0-indexed
PageMaster pageMaster = getNextPageMaster(masterName,
firstAvailPageNumber,
isFirstPage, isEmptyPage);
// a legal alternative is to use the last sub-sequence
// specification which should be handled in getNextSubsequence. That's not done here.
if (pageMaster == null) {
throw new FOPException("page masters exhausted. Cannot recover.");
}
Page p = pageMaster.makePage(areaTree);
if (currentPage != null) {
Vector foots = currentPage.getPendingFootnotes();
p.setPendingFootnotes(foots);
}
return p;