Puppeeter with cloudflare workers

Hello! I recently saw this github repo : https://github.com/cloudflare/puppeteer

I have a SvelteKit project hosted on Cloudflare Pages and I would like to add an invoice system. I'm not very talented with PDFs, so I want to create PDF from HTML code. The only way I found was to use Puppeteer to render an html page and save it as PDF.

I did all my pdf tests in a separate project, and now that I feel more comfortable with puppeteer, I want to include it to my SvelteKit project.

I still have issues in understanding the difference between Workers and Pages, but from what I read Pages is meant for static websites, therefore there's no nodejs environment for puppeteer to run on. So my question is: Does cloudflare/puppeteer is meant to be use in workers ? If yes, can I include it in my sveltekit app and host the project in workers rather than pages ?

Have a nice day!
GitHub
Puppeteer Core fork that works with Cloudflare Browser Workers - cloudflare/puppeteer
Was this page helpful?