Skip to content

Instantly share code, notes, and snippets.

View rack-pdf_preflight.rb
require 'base64'
require 'nokogiri'
module Rack
# Rack middleware to inline css and images from underlying application so it
# can be proccessed by PDFKit without additional network requests.
# For example, this middleware will transform this response:
# <html>
jpstroop /
Last active Dec 12, 2015
Lightning talk re: Loris <> for code4lib 2013.