I'm generating a pdf in landscape orientation, with the content (an invoice) coming as html rendered via jsrender.
it works fine in my local environment (windows 10) the generated pdf is in landscape orientation.
but when deployed to production, in ubuntu, the generated pdf is in portrait mode, i have tried setting the page width and height too, instead of the option {format : 'A4'}.
below is my code...
let template = jsrender.templates('./path/to/invoice-template.html');
let html = template.render({order: order});
let options = {format: 'A4',orientation: 'landscape'};
let file = "./temp/F" + new Date().getTime() + ".pdf"
pdf.create(html, options).toFile(file, function (err, response) {
if (err) {
// handle error
} else {
// process download
}
});
I'm generating a pdf in landscape orientation, with the content (an invoice) coming as html rendered via jsrender.
it works fine in my local environment (windows 10) the generated pdf is in landscape orientation.
but when deployed to production, in ubuntu, the generated pdf is in portrait mode, i have tried setting the page width and height too, instead of the option {format : 'A4'}.
below is my code...
what could be the possible cause, and solution?