I want to create a pdf using puppeteer/PDFOptions . It contains a base64 encoded image inside the headerTemplate:
await page.pdf({
displayHeaderFooter: true,
printBackground: true,
headerTemplate:
'<img class="header-logo" src="data:image/png;base64,${headerimgtry}" style="height:100px; width:100px">',
footerTemplate: '<h1">Footer</h1>',
margin: "30px",
format: "A4",
path: "output.pdf",
});
But instead of the image it only shows a placeholder:
How can I correctly display the image in the pdf?