Right now I'm using nodepdf (https://www.npmjs.org/package/nodepdf) for server-side PDF generation. I'm trying to add an image to the header of the pages generated, but it doesn't work.
Code:
var options = {
'paperSize': {
pageFormat: 'A4',
'header': {
height: '5cm',
contents: headerHTML
},
'footer': {
height: '3.55cm',
contents: footerHTML
}
}
};
headerHTML comes from something that looks like this:
res.render(url, options, function (err, html) {
if (err) { d.reject(err); }
d.resolve(html);
});
the header view:
<img style="width: 1cm; height: 1cm;" src="..." />
All of this is done through SailsJS.