If I wanted to programatically add headers and footers for each child template - how would I go about doing that? Each child requires a unique header i.e. Section 1, Section 2, Section 3. Each footer would require a page number so there would be a continuous flow throughout the whole document.
await reporter.documentStore.collection('templates').insert({
content: pages.page1,
engine: 'jsrender',
recipe: 'html',
name: 't1',
chrome: {
displayHeaderFooter: true,
footerTemplate: `TEST FOOTER TEMPLATE`,
margin: {
top: "2cm",
bottom: "3cm",
right: "1cm",
left: "1cm"
}
}
})
await reporter.documentStore.collection('templates').insert({
content: pages.page2,
engine: 'jsrender',
recipe: 'html',
name: 't2'
})
await reporter.documentStore.collection('templates').insert({
content: 'xx',
engine: 'jsrender',
recipe: 'html',
name: 't3'
})
const request = {
template: { content: '{#child t1} {#child t2} {#child t3}', engine: 'none', recipe: 'chrome-pdf' }
}
Thanks