📅  最后修改于: 2022-03-11 14:57:30.794000             🧑  作者: Mango
content: [{
text: getOfferClosingParagraph(),
id: 'closingParagraph'
}, {
text: getSignature(),
id: 'signature'
}],
pageBreakBefore: function(currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
//check if signature part is completely on the last page, add pagebreak if not
if (currentNode.id === 'signature' && (currentNode.pageNumbers.length != 1 || currentNode.pageNumbers[0] != currentNode.pages)) {
return true;
}
//check if last paragraph is entirely on a single page, add pagebreak if not
else if (currentNode.id === 'closingParagraph' && currentNode.pageNumbers.length != 1) {
return true;
}
return false;
},