Download the PHP package moonforge/scanforge without Composer
On this page you can find all versions of the php package moonforge/scanforge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moonforge/scanforge
More information about moonforge/scanforge
Files in moonforge/scanforge
Package scanforge
Short Description Official PHP SDK for the scan-forge OCR service
License MIT
Homepage https://moonforge.tech/produkty/scan-forge
Informations about the package scanforge
scanforge
Official PHP SDK for the scan-forge OCR service — an on-premise, AI-powered drop-in replacement for ABBYY Recognition Server.
Installation
Requires PHP 8.1+.
Quick Start
API Reference
new Client($apiKey, $baseUrl = 'https://api.scanforge.tech', $httpClient = null)
Creates a new client instance.
| Parameter | Type | Required | Default |
|---|---|---|---|
$apiKey |
string |
Yes | — |
$baseUrl |
string |
No | https://api.scanforge.tech |
$httpClient |
GuzzleHttp\Client\|null |
No | null (auto-created) |
ocr(string $filePath, array $options = []): OcrResult
Extracts text from a PDF or image file.
Options
| Key | Type | Default | Description |
|---|---|---|---|
language |
string |
'pol' |
OCR language code |
page_number |
int |
— | Process a single page (0-indexed) |
Returns OcrResult
Example
barcodes(string $filePath, array $options = []): BarcodeResult[]
Detects and decodes barcodes (1D and 2D) in a document.
Options
| Key | Type | Default | Description |
|---|---|---|---|
page_number |
int |
0 |
Page to scan (0 = all pages) |
Returns BarcodeResult[]
Example
convert(string $filePath, array $options = []): void
Converts a PDF or image to an editable document format. The output format is determined by the extension of $options['output'] (.docx → DOCX, .xlsx → XLSX).
Options
| Key | Type | Required | Description |
|---|---|---|---|
output |
string |
Yes | Destination path (.docx or .xlsx) |
language |
string |
No | OCR language code (default 'pol') |
Returns void — the converted file is written to output on the server.
Example
Error Handling
All methods throw ScanForgeException on failure.
| Error condition | $statusCode |
|---|---|
| Invalid API key | 401 |
| Unsupported file type | 422 |
| Server error | 5xx |
| Network / connection failure | null |
Configuration
Self-hosted deployment
Environment variables (recommended)
Requirements
- PHP 8.1+
- guzzlehttp/guzzle ^7.0 (installed automatically via Composer)
- A running scan-forge server — see deployment docs
License
MIT © Moonforge