Puppeteer not rendering color, background color when I try to save PDF on disk

Puppeteer is just a library to drive Chrome/Chromium, so if anything goes wrong while using it, our best bet is to open Chromium with puppeteer.launch({headless:false}) and debug there.

Set your page css in <style></style> tag.

You can solve the issue with the following CSS code:

html {
  -webkit-print-color-adjust: exact;
}
p {
  color: #FF0000; 
}

Leave a Comment