Hello,
I'm using jsreport with node, and I'm trying to show load a jsreport on PDF format with an image on it. Here are the code I'm writing:
let clientLogoPath = path.join(__dirname, "../public/images/temp/client_logo.jpg");
jsreport.init().then(() => {
jsreport.render({
template: {
content: `<h1 class="report-title">Report</h1><img src="{{asset "${clientLogoPath}" "dataURI"}}" />`,
engine: 'handlebars',
recipe: 'chrome-pdf'
},
}).then((out) => {
out.stream.pipe(res);
}).catch((e) => {
res.end(e.message);
}); }).catch((e) => {
console.error(e.stack)
process.exit(1)})
When I try to Run the following error occur:
Error when evaluating engine handlebars for template anonymous
Asset "Full Path image) not found.
I'm just starting with jsreport, can anyone please guide me through?