
Screenshot API for Ruby on Rails: Screenshots and PDFs Without wkhtmltopdf
Screenshot API for Ruby on Rails: Screenshots and PDFs Without wkhtmltopdf Generating PDFs and screenshots in Rails is one of those problems that looks simple until you actually try to deploy it. wkhtmltopdf requires a system binary. WickedPDF wraps wkhtmltopdf and adds a Rails DSL on top, but you're still shipping a binary in Docker and fighting with font paths in production. Prawn gives you programmatic PDFs, but it's a layout engine — you write Ruby to position every line of text, which means your HTML invoice template and your PDF invoice are two separate things to maintain. The REST API approach sidesteps all of this. You send a URL or an HTML string, get back a PDF or PNG. No binary dependencies. No DSL. No Dockerfile changes. Why Not wkhtmltopdf or WickedPDF? System dependency — wkhtmltopdf must be installed on every machine (dev, CI, production). Docker images grow by 100–200 MB. ARM vs x86 issues are common. Maintenance — wkhtmltopdf is no longer actively maintained. Its Chrom
Continue reading on Dev.to Webdev
Opens in a new tab




