Chartjs-Puppeteer is generating a .pdf with nearly 1000 blank pages when I am using Chart.js

0👍

You should wait until the content of the page is loaded before running pdf.
I recommend the domcontentloaded option.

const HTML = `${HTML_CONTENT}`
await page.setContent(HTML,
        {
          waitUntil: "domcontentloaded",
        },
      )

For more options check de docs.
https://pptr.dev/api/puppeteer.page.setcontent

Leave a comment