Using PhantomJS to generate PDFs, via a webservice. Runs using Node.js.
See it in action at: html2pdf.it.
Ready to fork and push to Heroku (where I run it).
Works out of the box on both Windows and Ubuntu.
On Mac you need to:
brew install phantomjs
npm install
This also opens your webbrowser on the local webserver
node open.js
node lib/app.js
If you want to host html2pdf.it yourself, you will have to ask your host if they support hosting Node.js applications. Node.js is still new, so a lot of hosts don't support it.
If your host does not support Node.js you'll need to find a new host that does. Check out Heroku.com or nodejitsu.com, for example.
npm test
- Routing etc. is done with
express
- Testing is done with
mocha
,chai
andsinon
, using BDD style tests. - JSHint is run on the JavaScript code
Version 0.10+ of Node.js is required (Domains are used for catching errors, and domains were not really stable before 0.10).