pdf-invoice

1.0.2 • Public • Published

pdf-invoice

Install

$ npm i -s pdf-invoice

Usage

const pdfInvoice = require('pdf-invoice')
 
const document = pdfInvoice({
  company: {
    phone: '(99) 9 9999-9999',
    email: 'company@evilcorp.com',
    address: 'Av. Companhia, 182, Água Branca, Piauí',
    name: 'Evil Corp.',
  },
  customer: {
    name: 'Elliot Raque',
    email: 'raque@gmail.com',
  },
  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')
 
docucment.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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    5
  • 1.0.0
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i pdf-invoice

Weekly Downloads

5

Version

1.0.2

License

MIT

Last publish

Collaborators

  • gabrielrubens