require 'rubygems' require 'sinatra' require 'prawn'
get '/' do "<h1>This is a simple pdf rendering webservice. GET <a href='/hello%20world.pdf'>/hello%20world.pdf</a> to get a pdf back!</h1>" end
get '/*' do content_type('application/pdf') headers['Cache-Control'] = "public, max-age=6000000000000000000"
pdf = Prawn::Document.new pdf.text(params[:splat][0].gsub(/.pdf\z/,'')) pdf.render
require 'rubygems' require 'sinatra' require 'prawn'
get '/' do "<h1>This is a simple pdf rendering webservice. GET <a href='/hello%20world.pdf'>/hello%20world.pdf</a> to get a pdf back!</h1>" end
get '/*' do content_type('application/pdf') headers['Cache-Control'] = "public, max-age=6000000000000000000"
end