Project

pdfservice

0.01
No commit activity in last 3 years
No release in over 3 years
Run your own html-to-pdf server for free on Heroku.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

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.