Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 997 Bytes

README.md

File metadata and controls

44 lines (30 loc) · 997 Bytes

phantom-renderserver

Simple phantomjs-based html2pdf renderserver for Heroku.

Setup

Fork and create a heroku project with phantom buildpack

heroku create --stack cedar --buildpack http://github.com/stomita/heroku-buildpack-phantomjs.git

How to use

Pass a URL as query string.

GET http://phantom-renderserver.herokuapp.com/?http://google.com/

Send an HTML document as POST body.

POST http://phantom-renderserver.herokuapp.com/

<!doctype html>
<html>
  <head>...</head>
  <body>...</body>
</html>

This implementation outputs PDFs in A4 portrait format. You might want to change for to your needs.

Caution: The web server in phantomjs is not considered robust, so you shouldn't really use this in production.

Credits

Based on html2pdf.js by Thomas Bley.

License

MIT © Norman Rzepka 2014