🎨 Exporting Canva presentations to PDF
A short one. We needed to export Canva presentations to PDF programmatically, and Canva’s own export options weren’t cutting it. So I wrote a Playwright script that opens a public Canva presentation in a headless browser, auto-detects the number of slides by navigating through them, captures each as a 1920x1080 screenshot, and stitches them into a PDF using pdf-lib.
It’s a focused utility — about 100 lines of Node.js — that solves a specific pain point. The interesting bit is the slide detection: since there’s no reliable way to query the total slide count from the DOM, the script clicks “next” until the slide stops changing, counting as it goes.
Tech: Node.js, Playwright, pdf-lib.