Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astrocoders/node-pdf-invoice
A Phantom free PDF invoice generator built with PDFKit
https://github.com/astrocoders/node-pdf-invoice
pdf pdf-invoice
Last synced: 3 months ago
JSON representation
A Phantom free PDF invoice generator built with PDFKit
- Host: GitHub
- URL: https://github.com/astrocoders/node-pdf-invoice
- Owner: Astrocoders
- License: mit
- Created: 2016-09-23T00:53:59.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2019-05-02T13:58:54.000Z (almost 6 years ago)
- Last Synced: 2024-11-13T01:51:50.001Z (3 months ago)
- Topics: pdf, pdf-invoice
- Language: JavaScript
- Size: 13.7 KB
- Stars: 61
- Watchers: 2
- Forks: 29
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pdf-invoice
===========# Install
```
$ npm i -s pdf-invoice
```# Usage
```js
const pdfInvoice = require('pdf-invoice')const document = pdfInvoice({
company: {
phone: '(99) 9 9999-9999',
email: '[email protected]',
address: 'Av. Companhia, 182, Água Branca, Piauí',
name: 'Evil Corp.',
},
customer: {
name: 'Elliot Raque',
email: '[email protected]',
},
items: [
{amount: 50.0, name: 'XYZ', description: 'Lorem ipsum dollor sit amet', quantity: 12},
{amount: 12.0, name: 'ABC', description: 'Lorem ipsum dollor sit amet', quantity: 12},
{amount: 127.72, name: 'DFE', description: 'Lorem ipsum dollor sit amet', quantity: 12},
],
})// That's it! Do whatever you want now.
// Pipe it to a file for instance:const fs = require('fs')
document.generate() // triggers rendering
document.pdfkitDoc.pipe(fs.createWriteStream('path/to/file.pdf'))
```Checkout this PDF demo at https://github.com/Astrocoders/node-pdf-invoice/blob/master/tests/testing.pdf