Skip to content

re: Generate a PDF in AWS Lambda with NodeJS and Puppeteer VIEW POST


Thanks for the article.
I have an issue where the pdf comes empty randomly, to solve it setContent should wait for everything to be loaded.

await page.setContent(html, { waitUntil: ['load', 'domcontentloaded', 'networkidle0'] });

Thanks :) Very good point and interesting find. I haven't seen this when loading html as string but this very well can happen.

WaitUntil is very good to use and even necessary if page itself loads external content.

code of conduct - report abuse