1

Im using html-pdf to convert a compiled ejs with dynamic values to PDF in ejs. When I try to render the ejs file all the scripts , images , svg are loading correctly , but when I generate PDF from compiled ejs some assets like fonts , and images are missing . I don't know where i'm going wrong

var compiled = ejs.compile(fs.readFileSync('./views/template.ejs', 'utf8'));

var html = compiled({data :data1 , data2 : data2});

pdf.create(html,options).toFile('./public/pdf/'+today+'.pdf', function(err, response) {
     if (err) return console.log(err);
     console.log(response); 
}
});

0 Answers0