
Screenshot API and HTML to PDF in Rust with reqwest
Screenshot API and HTML to PDF in Rust with reqwest If you've tried running headless Chrome from a Rust binary, you know the friction: chromiumoxide pulls in a large async runtime dependency surface, headless_chrome is fragile against Chrome version bumps, and your final binary now ships with — or implicitly requires — a 300 MB Chrome installation. For many backend services, that's the wrong tradeoff. A REST screenshot API gives you the same rendered output without any of that. Your Rust binary stays lean. You call an endpoint, get back bytes. This guide covers doing exactly that with PageBolt using reqwest , tokio , and serde_json . Why Not chromiumoxide or headless_chrome? Both crates work. The maintenance cost is the problem: Chrome binary coupling — Your service breaks whenever the system Chrome version diverges from what the crate expects. Docker image bloat — A minimal Rust app image is ~10 MB. Add headless Chrome and you're at 1–2 GB. Memory management — You own the browser proc
Continue reading on Dev.to Webdev
Opens in a new tab




