# boleto-pdf

> boleto pdf generetor

Latest version **0.4.0** (published 2020-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install boleto-pdf
pnpm add boleto-pdf
yarn add boleto-pdf
bun add boleto-pdf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-02-18 |
| First published | 2017-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 410 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Rafael Castro |
| Maintainers | rafaelc457ro |
| Keywords | boleto, pdf, js |

## Links

- npm: https://www.npmjs.com/package/boleto-pdf
- Repository: https://github.com/boleto-br/boleto-pdf
- Homepage: https://github.com/boleto-br/boleto-pdf#readme
- Issues: https://github.com/boleto-br/boleto-pdf/issues
- npm.io page: https://npm.io/package/boleto-pdf

## Dependencies (2)

- [luxon](https://npm.io/package/luxon.md) ^1.2.1
- [pdfkit](https://npm.io/package/pdfkit.md) ^0.8.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.4.0 (latest) — 2020-02-18
- 0.3.0 — 2020-02-09
- 0.2.4 — 2018-05-12
- 0.2.3 — 2018-05-11
- 0.2.2 — 2017-10-01
- 0.2.1 — 2017-10-01
- 0.2.0 — 2017-10-01
- 0.1.2 — 2017-09-18
- 0.1.1 — 2017-09-18
- 0.1.0 — 2017-09-18
- 0.0.4 — 2017-09-11
- 0.0.3 — 2017-09-11
- 0.0.2 — 2017-09-11
- 0.0.1 — 2017-09-10

## README

# boleto-pdf

[![npm (scoped)](https://img.shields.io/npm/v/boleto-pdf.svg)](https://www.npmjs.com/package/boleto-pdf)
[![Travis](https://img.shields.io/travis/boleto-br/boleto-pdf.svg)](https://travis-ci.org/boleto-br/boleto-pdf)
[![Coveralls](https://img.shields.io/coveralls/boleto-br/boleto-pdf.svg)](https://coveralls.io/github/boleto-br/boleto-pdf?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/boleto-br/boleto-pdf.svg)](https://greenkeeper.io/)

> 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](https://www.npmjs.com/package/boleto-br).

Suporte:

| Barco        |  Suporte             |
|--------------|----------------------|
| Bradesco     |  :white_check_mark:  |
| OMNI         |  :white_check_mark:  |
| Caixa        |  Em breve            |
| Santander    |  Help Wanted         |
| Itaú         |  Help Wanted         |
| Outros       |  Help Wanted         |

## Instalação

Este projeto usa [node](http://nodejs.org) e [npm](https://npmjs.com).
Verifique em seu sistema se já estão instalados, corretamente.

```sh
$ npm install boleto-pdf --save

```

## Uso

```js
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](CONTRIBUTING.md).

## Licença

[MIT License](LICENSE.md) © [Rafael Castro](https://twitter.com/rafaelc457ro)

---
_Source: https://npm.io/package/boleto-pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
