I am trying to concatenate multiple pdf files to a content variable. However I want each pdf content to be on a new page, but pdfmake.js just concatenate each content right after the other. I have added 'pageBreakBefore' function right after my content but it still doesn't work. Is there a way to make each content to be on separate page. (I am using jpdmake.js 1.60). Thanks!
Below is my code:
let content = [];
content = this.getContent(checkedOrders, selectedLabOrders);
this.docDefinition = {
info: {
title: 'Title',
subject: 'labOrder-'
},
pageSize: 'LETTER',
pageOrientation: 'landscape',
pageMargins: [40, 30, 40, 30],
content: content,
pageBreakBefore: function(currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
return currentNode.headlineLevel === 1 && followingNodesOnPage.length === 0;
},
unbreakable: true,
styles: {
titleHeader: {
fontSize: 16,
bold: true,
margin: [0, 10, 0, 0],
},
tableHeader: {
bold: true,
fontSize: 13,
color: 'black'
}
},
defaultStyle: {
fontSize: 9,
lineHeight: .9
}
};