pdf.displayHeaderFooter to true, then pass HTML in pdf.headerHtml and pdf.footerHtml. Base64-encode each HTML fragment when sending JSON directly. The Node.js SDK accepts the HTML as text. See PDF options.
Example
Use
pdf.margin.top and pdf.margin.bottom to leave room for the header and footer.