PHPackages                             ewersonfc/linhadigitavel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ewersonfc/linhadigitavel

ActiveLibrary

ewersonfc/linhadigitavel
========================

1.8.0(6y ago)623.3k↑50%2[2 PRs](https://github.com/Ewersonfc/linhadigitavel/pulls)MITPHP

Since Jul 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Ewersonfc/linhadigitavel)[ Packagist](https://packagist.org/packages/ewersonfc/linhadigitavel)[ RSS](/packages/ewersonfc-linhadigitavel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (22)Used By (0)

linhadigitavel
==============

[](#linhadigitavel)

[![Latest Stable Version](https://camo.githubusercontent.com/c6abbb1eca03bf6a7745d3978a9831eabc7fd147b06bb18225a44f4c281d9017/68747470733a2f2f706f7365722e707567782e6f72672f65776572736f6e66632f6c696e686164696769746176656c2f76)](//packagist.org/packages/ewersonfc/linhadigitavel)[![Latest Unstable Version](https://camo.githubusercontent.com/2d6aeaa9ef45535c62f4042bcd6be35beb46af75b0e1e342660a687de9a636e0/68747470733a2f2f706f7365722e707567782e6f72672f65776572736f6e66632f6c696e686164696769746176656c2f762f756e737461626c65)](//packagist.org/packages/ewersonfc/linhadigitavel)[![Total Downloads](https://camo.githubusercontent.com/375d634c8a51528c52c6c3379df340205ce379e067f71c34602980882549e9b3/68747470733a2f2f706f7365722e707567782e6f72672f65776572736f6e66632f6c696e686164696769746176656c2f646f776e6c6f616473)](//packagist.org/packages/ewersonfc/linhadigitavel)[![License](https://camo.githubusercontent.com/95f2144769d6f2825a4d0a2568649143cbf220dab8fe9493ff8536227e8db497/68747470733a2f2f706f7365722e707567782e6f72672f65776572736f6e66632f6c696e686164696769746176656c2f6c6963656e7365)](//packagist.org/packages/ewersonfc/linhadigitavel)

Esta biblioteca tem a finalidade de extrair a Linha Digitável de boletos **PDF 1.4 e 1.7** e Imagens. Em algumas situações especificas a mesma usa auxílio da API do OCR SPACE (), fazendo assim necessária a Key da API para maior taxa de sucesso na Extração.

Instanciando a Classe
---------------------

[](#instanciando-a-classe)

```
$class = new LinhaDigitavel([
    'type' => TypeConstant::ELIMINATION, // required
    'apiKey' => 'xxxxxxx', // requred
    'production' => true, // Optional
    'tempFolder' => './PATH_TO_TEMP_FOLDER' // Optional
]);

```

Parâmetros disponiveis
----------------------

[](#parâmetros-disponiveis)

### type (Required) :

[](#type-required-)

Esse parâmetro é utilizado para definir a forma que será realizado o *Parse* do arquivo, sendo as opções disponiveis:

- **'pdf'** : Realiza o parse diretamente na biblioteca, funcionando muito bem e rapido para arquivos PDF gerados através da Web ou programas.
- **'img'** : É um pouco mais lento que a opção anterior por utilizar a *API* do OCR SPACE, mas em alguns casos, onde serão utilizadas imagens ou PDF's contendo boletos scanneados tem uma taxa maior de sucesso.
- **'elimination'** : Tenta realizar o parse com o método *'pdf'* e **caso não consiga**, tenta utilizar o método *'img'*.
- **'both'** : Realiza a extração com ambos métodos.

### *apiKey* (Required) :

[](#apikey-required-)

Chave de acesso da API do OCR SPACE () utilizada para o parser das Imagens

### *production* (Optional) :

[](#production-optional-)

Este parâmetro é utilizado para controlar o uso da API Key

### *tempFolder* (Optional) :

[](#tempfolder-optional-)

Durante o processo a biblioteca cria alguns arquivos temporários para controlar qual servidor da API será utilizado, esse parametro serve para controlarmos onde esses arquivos temporarios serão salvos.

Extraindo a Linha Digitável
---------------------------

[](#extraindo-a-linha-digitável)

### Método

[](#método)

```
$linhadigitavel = $class->convertArchive("https://[LINK_PARA_O_BOLETO].pdf");

```

### Response

[](#response)

```
Array
(
    [html] => Array
        (
        )

    [img] => Array
        (
            [0] => Array
                (
                    [0] => 200000000000000000000001020500000000000000000200
                )
        )
);

```

\*\* Exemplo meramente ilustrativo

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~47 days

Total

19

Last Release

2547d ago

Major Versions

0.1 → 1.02018-07-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11252610?v=4)[Ewersonfc](/maintainers/Ewersonfc)[@Ewersonfc](https://github.com/Ewersonfc)

---

Top Contributors

[![Ewersonfc](https://avatars.githubusercontent.com/u/11252610?v=4)](https://github.com/Ewersonfc "Ewersonfc (8 commits)")[![kaio-souza](https://avatars.githubusercontent.com/u/16223766?v=4)](https://github.com/kaio-souza "kaio-souza (2 commits)")

### Embed Badge

![Health badge](/badges/ewersonfc-linhadigitavel/health.svg)

```
[![Health](https://phpackages.com/badges/ewersonfc-linhadigitavel/health.svg)](https://phpackages.com/packages/ewersonfc-linhadigitavel)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
