Skip to content

allardvanderouw/node-html-to-pdf-with-handlebars-and-wkhtmltopdf

Repository files navigation

node-html-to-pdf-with-handlebars-and-wkhtmltopdf

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.

Vagrant

The example uses Vagrant to install xvfb & wkhtmltopdf.

Heroku

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.

About

Convert an HTML (Handlebars) template to a PDF file using wkhtmltopdf.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published