Download the PHP package eugenefvdm/fnb-pdf-statement-parser without Composer

On this page you can find all versions of the php package eugenefvdm/fnb-pdf-statement-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fnb-pdf-statement-parser

Dependencies

This package requires the following system tools:

Usage

The package can be used standalone:

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

Running Tests

Testing Methodology

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

1. Basic Test Script

Create a test script to analyze parsing results:

2. Analyzing Extracted Text

To debug OCR or parsing issues, save and examine the extracted text:

3. Common Issues to Check

  1. OCR Quality Issues:

    • Check for corrupted dates (e.g., "2211 JJuunn" instead of "21 Jun")
    • Look for spaces in decimal numbers (e.g., "9,844. 46Cr" instead of "9,844.46Cr")
    • Check for spaces before commas (e.g., "48 ,969.15Cr" instead of "48,969.15Cr")
    • Verify digit recognition errors (e.g., "929.20" instead of "529.20")
  2. Parsing Issues:

    • Verify transactions are on single lines (not split across multiple lines)
    • Check if amounts are being extracted correctly
    • Verify credit/debit classification is correct
  3. Validation:
    • Compare expected vs actual transaction counts
    • Verify all credit transactions are identified
    • Check for misclassified transactions (credits as debits or vice versa)

4. Testing Specific PDFs

To test a specific PDF file:

5. PDF Processing Pipeline

The parser follows a multi-step processing pipeline:

  1. PDF Decryption (qpdf): Removes security restrictions from PDFs before OCR processing. Some PDFs aren't password-protected but have restrictions (like "modify anything: not allowed" or "print high resolution: not allowed") that ocrmypdf treats as encryption, causing exit code 8. The qpdf --decrypt command removes these restrictions.

  2. OCR Processing (ocrmypdf): Uses maximum quality OCR settings (see Quality Settings section below).

  3. Text Extraction (pdfplumber): Extracts text from the OCR'd PDF with fallback strategies for optimal results (see Quality Settings section below).

Quality Settings

This package uses maximum quality settings across all processing stages to ensure accurate extraction from scanned PDFs. All quality flags are documented below:

OCR Processing (ocrmypdf)

Located in src/Processor/PdfProcessor.php, the following maximum quality settings are used:

Text Extraction (pdfplumber)

Located in src/Processor/PdfProcessor.php, the following extraction settings are used:

Note: The extraction process first attempts simple extraction (which keeps text on the same line), and only falls back to layout extraction with these tolerance settings if the simple extraction yields poor results (less than 100 characters per page).

Quality Philosophy

All settings prioritize accuracy over performance, ensuring reliable extraction from scanned PDFs. The 400 DPI setting, LSTM OCR engine, lossless compression, and high-quality preprocessing ensure maximum character recognition accuracy for financial documents.

Tesseract OCR Engine Mode 3 — LSTM (best accuracy) Optimize 0 — No compression (preserves quality) PDF/A Image Compression: lossless — Maximum quality Deskew & Clean — Maximum preprocessing enabled Force OCR — Always performs OCR Appropriately set (not higher, but optimal): DPI 400 — High quality for OCR. Higher DPI (e.g., 600) offers diminishing returns and much longer processing. 400 DPI is a good balance for financial documents. Page Segmentation Mode 4 — Single-column mode, appropriate for financial statements. Other modes exist but aren’t better for this use case. pdfplumber tolerances — These are fallback settings. The primary extraction (simple, no layout) is higher quality. Tolerances are only used if simple extraction fails.


All versions of fnb-pdf-statement-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/ray Version ^1.44
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eugenefvdm/fnb-pdf-statement-parser contains the following files

Loading the files please wait ...