
Screenshot API for Kotlin: Screenshots and PDFs Without a JVM Browser
Screenshot API for Kotlin: Screenshots and PDFs Without a JVM Browser Generating a PDF from HTML or capturing a screenshot in a Kotlin project leads most developers down a painful path: Selenium, WebDriver, or a full headless Chrome setup on the JVM. These work, but they're heavy — Selenium alone pulls in dozens of transitive dependencies, WebDriver binaries need version-pinning, and running headless Chrome in a Kotlin backend or Android project is either awkward or impossible. The cleaner approach: call a screenshot API. You send an HTTP request, get back binary image or PDF data. No browser process, no JVM–Chromium glue code, no container bloat. This guide covers PageBolt — a hosted capture API with 100 free requests per month, no credit card required — using OkHttp (Android-friendly) and Ktor client (backend Kotlin). Why Not Selenium or JVM Headless Chrome? Selenium setup : WebDriverManager, ChromeDriver version mismatches, and System.setProperty boilerplate before you write a singl
Continue reading on Dev.to Webdev
Opens in a new tab




