PHPackages                             eugenefvdm/fnb-pdf-statement-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. eugenefvdm/fnb-pdf-statement-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

eugenefvdm/fnb-pdf-statement-parser
===================================

Standalone PHP package for processing FNB bank statement PDFs, extracting transactions, and validating debit/credit counts

0.1.0(5mo ago)015MITPHPPHP ^8.2

Since Dec 2Pushed 5mo agoCompare

[ Source](https://github.com/eugenefvdm/fnb-pdf-statement-parser)[ Packagist](https://packagist.org/packages/eugenefvdm/fnb-pdf-statement-parser)[ RSS](/packages/eugenefvdm-fnb-pdf-statement-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (2)Used By (0)

Dependencies
============

[](#dependencies)

This package requires the following system tools:

- **qpdf**: Used to decrypt PDFs and remove security restrictions before OCR processing
    - Install on macOS: `brew install qpdf`
    - Install on Ubuntu/Debian: `sudo apt-get install qpdf`
- **ocrmypdf**: Used for OCR processing of scanned PDFs
    - Install on macOS: `brew install ocrmypdf`
    - Install on Ubuntu/Debian: `sudo apt-get install ocrmypdf`
- **python3** with **pdfplumber**: Used for text extraction from OCR'd PDFs
    - Install: `pip3 install pdfplumber`

Usage
=====

[](#usage)

The package can be used standalone:

```
use FnbStatementParser\FnbStatementParser;

$parser = new FnbStatementParser();
$result = $parser->process('/path/to/statement.pdf');

// Access transactions, validation, metadata
$transactions = $result->transactions;
$validation = $result->validation;
$csv = $result->toCsv();
```

For example, a Laravel app can use this package through a BankStatement model's processPdf() method. All processing logic has been extracted to the standalone package, making it reusable and framework-agnostic.

Testing
-------

[](#testing)

### Running Tests

[](#running-tests)

```
./vendor/bin/pest
```

### Testing Methodology

[](#testing-methodology)

When testing new PDF files or debugging parsing issues, use this methodology:

#### 1. Basic Test Script

[](#1-basic-test-script)

Create a test script to analyze parsing results:

```
