This module shows how to convert an HTML (Handlebars) template to a PDF file using wkhtmltopdf.
Example:
vagrant up
vagrant ssh
cd /vagrant
yarn start
Open your browser and go to http://localhost:3000/?name=Alice
. This will open a PDF-file with Alice on the initial line.
The example uses Vagrant to install xvfb & wkhtmltopdf.
It is required to add a Buildpack to use wkhtmltopdf.
This can be done by manually adding the buildpack on your Heroku App in "Settings" → "Buildpacks".
https://github.com/allardvanderouw/heroku-buildpack-wkhtmltopdf.git
Or execute it on the Heroku CLI:
heroku buildpacks:add https://github.com/allardvanderouw/heroku-buildpack-wkhtmltopdf.git
Open your browser and go to https://<<your-app>>.herokuapp.com/?name=Alice
. This will open a PDF-file with Alice on the initial line.