Simple invoice generator that takes HTML template and generates PDF invoice based on JSON input. Example template uses sparksuite/simple-html-invoice-template.
Find PDF demo here.
See preview in browser
node render-preview.js && open preview.html
Deploy
- replace
BUCKET_NAME
gcloud beta functions deploy generateInvoice --stage-bucket BUCKET_NAME --trigger-http
Usage
- replace
GCF_URL
- run following command and see
test-invoice.pdf
curl -X POST "GCF_URL" -H "Content-Type:application/json" --data '
{
"id":"808xD",
"dateIssue":"1. 1. 2019",
"dateDue":"1. 2. 2019",
"companyAddressLines":[
"Random Company",
"7687 Edgemont St. ",
"02026",
"VAT Reg no: 32162"
],
"userAdressLines":[
"John Doe",
"440 Cedar Street",
"VAT Reg no: 90403"
],
"item": {
"name":"Monthly Subscription Plan ",
"price":"150 USD"
},
"status":"PAID"
}' > test-invoice.pdf
Used font in this repository is Roboto, licensed under Apache License, Version 2.0