Generate PDF invoices using HTML templates and mustaches!
npm install falcon-invoice
Check out test/index.js
for a more detailed example!
const invoice = require('falcon-invoice')
const template = '/path/to/template'
const templateVariables = {
name: 'Herp Derpington'
}
// Optional options
const options = {
filename: 'differentName.pdf',
pdfOptions: {
orientation: 'landscape'
}
}
invoice(template, templateVariables, options).then(function(success){
}).catch(function(error){
});
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>
Customer Name: {{name}}
</p>
</body>
</html>
This package uses: html-pdf and mustache
I got my test html template from: https://github.com/NextStepWebs/simple-html-invoice-template