0.4.0 • Published 4 years ago

boleto-pdf v0.4.0

Weekly downloads
35
License
MIT
Repository
github
Last release
4 years ago

boleto-pdf

npm (scoped) Travis Coveralls Greenkeeper badge

Um simples gerador de pdf de boletos de bancos brasileros.

Esse projeto tem como objetivo apenas gerar o pdf do boleto, ele não cria linhas digitáveis, nem cria o número do código de barras e etc. Para isso recomendo o uso do boleto-br.

Suporte:

BarcoSuporte
Bradesco:white_check_mark:
OMNI:white_check_mark:
CaixaEm breve
SantanderHelp Wanted
ItaúHelp Wanted
OutrosHelp Wanted

Instalação

Este projeto usa node e npm. Verifique em seu sistema se já estão instalados, corretamente.

$ npm install boleto-pdf --save

Uso

const fs = require('fs')
const {bradesco} = require('boleto-pdf')

const boleto = {
  barcodeData: '23797726700000009997506091900000120800542910',
  digitableLine: '23797.50603 91900.000125 08005.429108 7 72670000000999',
  paymentPlace:
    'Pagável preferencialmente na rede Bradesco ou Bradesco Expresso.',
  beneficiary: 'UNICRED FLORIANÓPOLIS - CNPJ: 074.064.502/0001-12',
  beneficiaryAddress:
    'Rua Tenete Silveira, 315 - Centro - Florianópolis - SC  - CEP 88010-301',
  instructions:
    'Após o vencimento cobrar multa de 2,00% , mais juros ao mes de 1,00%.',
  agency: '7506',
  agencyDigit: '0',
  account: '54291',
  accountDigit: '1',
  expirationDay: new Date(2017, 7, 30), // 30/08/2017
  documentDate: new Date(2017, 7, 18), // 18/08/2017
  processingDate: new Date(2017, 7, 18), // 18/08/2017
  card: '09',
  documentNumber: '42493',
  formatedOurNumber: '09/19000001208-0',
  formatedValue: 'R$ 9,90',
  documentType: 'DS',
  accept: 'N',
  currencyType: 'Real (R$)',
  amount: ' ',
  valueOf: ' ',
  descountValue: ' ',
  otherDiscounts: ' ',
  feeValue: ' ',
  outherFees: ' ',
  chargeValue: ' ',
  payer: {
    name: 'Anita Albuquerque',
    registerNumber: '221.412.772-05',
    street: 'Rua Maria Gertrudes Coelho',
    number: '827',
    complement: ' ',
    district: 'Estrada Nova',
    city: 'Divinópolis',
    state: 'MG',
    postalCode: '35500-700'
  },
  guarantor: {
    name: 'ACME Telecomunicações Ltda',
    registerNumber: '074.064.502/0001-12',
    street: 'Servidão',
    number: '439',
    district: 'Estrada Nova',
    complement: ' ',
    city: 'Jaraguá do Sul',
    state: 'SC',
    postalCode: '89254-375'
  }
}

bradesco(boleto).then( data => {
  fs.writeFile('boleto.pdf',data,'binary', err =>{
    if(err){
      console.log(err)
      return
    }

    console.log('file saved')
  })
}).catch(err =>{
  console.log(err)
})

Contribuindo

Veja o contributing file.

Licença

MIT License © Rafael Castro

0.4.0

4 years ago

0.3.0

4 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago