This is my node.js and HTML template code which creates a PDF from an HTML template. It's not putting in the colors.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("file:///D:/pdf_export/template/template.html");
await page.pdf({
path: 'output.pdf',
printBackground: true
});
await browser.close();
})()
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<p style="color: red;">Hello World</p>
</body>
</html>
When I open the output.pdf, it only shows 'Hello world' in black not in red.