项目作者: cernockyd

项目描述 :
Simple GCF invoice pdf generator
高级语言: JavaScript
项目地址: git://github.com/cernockyd/gcf-invoice-generator.git
创建时间: 2019-02-10T22:44:35Z
项目社区:https://github.com/cernockyd/gcf-invoice-generator

开源协议:

下载


Google Cloud Function Invoice Generator

Simple invoice generator that takes HTML template and generates PDF invoice based on JSON input.
Example template uses sparksuite/simple-html-invoice-template.

screenshot

Demo

Find PDF demo here.

Get started

See preview in browser

  1. node render-preview.js && open preview.html

Deploy

  • replace BUCKET_NAME
  1. gcloud beta functions deploy generateInvoice --stage-bucket BUCKET_NAME --trigger-http

Usage

  1. replace GCF_URL
  2. run following command and see test-invoice.pdf
  1. curl -X POST "GCF_URL" -H "Content-Type:application/json" --data '
  2. {
  3. "id":"808xD",
  4. "dateIssue":"1. 1. 2019",
  5. "dateDue":"1. 2. 2019",
  6. "companyAddressLines":[
  7. "Random Company",
  8. "7687 Edgemont St. ",
  9. "02026",
  10. "VAT Reg no: 32162"
  11. ],
  12. "userAdressLines":[
  13. "John Doe",
  14. "440 Cedar Street",
  15. "VAT Reg no: 90403"
  16. ],
  17. "item": {
  18. "name":"Monthly Subscription Plan ",
  19. "price":"150 USD"
  20. },
  21. "status":"PAID"
  22. }' > test-invoice.pdf

Font license

Used font in this repository is Roboto, licensed under Apache License, Version 2.0