PSPDFKit-labs / pspdfkit-server-invoice

Project showcasing creation of invoices from a template with PSPDFKit Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating invoice with PSPDFKit Server

This is a small project in Node.js which creates invoices from a template using PSPDFKit Server.

See the accompanying blog post at https://pspdfkit.com/blog/2020/creating-invoices-with-pspdfkit-server-part-1/.

How-to

Written with Node.js 12.8.3. To use it, clone the repository and run

npm install
export SERVER_PORT=5000 # Local port PSPDFKit Server will listen on.
export SERVER_API_AUTH_TOKEN=secret # Authentication token used by Server API.
export ACTIVATION_KEY=... # Your Server activation key.
docker-compose up -d

After that, you can create the invoice template by running node createTemplate.js. In order to generate an invoice, run node createInvoice.js - the resulting PDF file will be saved at ./invoice.pdf. You can modify the invoice data in invoice.json file to see a different result.

About

Project showcasing creation of invoices from a template with PSPDFKit Server


Languages

Language:JavaScript 100.0%