This repo has been inspired from xml-pdf.
const { xml2pdfAsync } = require('./index');
const xml = '...';
const options = {
template: '<main template>'
};
xml2pdfAsync(xml, options).then(res => {
// res is the pdf
}).catch(err => ...));
const { xml2pdfAsync } = require('./index');
const xml = '...';
const options = {
template: '...',
header: {
height: '10mm', // see html-pdf height options
template: '<header template>'
},
footer: {
height: '10mm', // see html-pdf height options
template: '<footer template>'
}
};
xml2pdfAsync(xml, options).then(res => {
// res is the pdf
}).catch(err => ...));
See test
folder with header and footer examples.