html-pdf を使用して、動的な値を持つコンパイル済みの ejs を ejs の PDF に変換します。ejs ファイルをレンダリングしようとすると、すべてのスクリプト、画像、svg が正しく読み込まれますが、コンパイルされた ejs から PDF を生成すると、フォントや画像などのアセットが失われます。どこが間違っているのかわからない
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);
}
});