Closed shivampandey2021 closed 5 years ago
Are you looking to use an HTML file instead of just a text template?
const fs = require('fs')
let document = {
template: fs.readFileSync('document.html', 'utf8'),
context: {
msg: 'Hello world'
},
path: "./test-"+Math.random()+".pdf"
}
This assumes your file is saved in utf8
Thanks for your response.
After using a separate html file the content does not fit to pdf page When I am running it on PRODUCTION. The width of the content is more than the pdf page and content got cut from the right side. Any help?
How can I separate HTML file and give path to that HTML ?