Skip to content
A rack app for converting HTML to PDF via a HTTP call http://github.com/JackDanger/pdfservice
Ruby
Find file
Failed to load latest commit information.
lib specifying sinatra version
vendor finding better placement for big binary
Gemfile specifying sinatra version
Gemfile.lock specifying sinatra version
LICENSE Releasing under the MIT
README.markdown
Rakefile not requiring sinatra except for the server
VERSION Version bump to 1.2.1
config.ru created version 1.0.0 of pdfservice
pdfservice.gemspec
test.rb testing under 1.9.1

README.markdown

PDF Service

This is a simple Rack server that accepts web requests posting HTML to be converted into PDF. Uses the wkhtmltopdf binaries.

Instant installation and deploy

  • Clone this: git clone git://github.com/JackDanger/pdfservice.git
  • Signup for an account at Heroku (better details here)
  • push it to Heroku.com: git push heroku master

HowTo

Once the server is running you need to post a string of html to it and that string will be rendered in WebKit and returned to you as a PDF document.

require 'pdfservice'
client = PdfService::Client.new 'http://my-pdfservice-app.heroku.com'
pdf_content = client.render '<html></html>'

Or, straight from a terminal:

curl -X POST http://my-pdfservice-app.heroku.com/ -d '<html></html>' > file.pdf

Patches welcome, forks celebrated.

Copyright (c) 2010 Jack Danger Canty. Released under the MIT License.

Something went wrong with that request. Please try again.