# Changelog of Document Processing API — PDF, OCR & Validated JSON (`scalogik/document-processing-api-pdf-ocr-validated-json`) Actor

- **URL**: https://apify.com/scalogik/document-processing-api-pdf-ocr-validated-json/changelog.md
- **Full Actor documentation**: https://apify.com/scalogik/document-processing-api-pdf-ocr-validated-json.md

## Changelog

### 0.2.7 — Standalone image request-size safeguard

- Extended bounded visual-image preparation to direct PNG, JPEG, WebP, and TIFF uploads.
- Direct images are now normalized to a safely sized JPEG before managed extraction, avoiding oversized base64 payloads.
- Added explicit free `IMAGE_TOO_COMPLEX` and `IMAGE_INVALID` errors for unsupported visual-preparation failures.

### 0.2.6 — Advertised validation and routing contract

- Implemented the publicly advertised `exists`, `regex`, `gt`, and `lt` validation operators. Regex validation uses full-string matching, a 500-character pattern limit, a 10,000-character value limit, and a short timeout.
- Implemented the advertised `review_all` route policy while retaining the existing `standard`, `conservative`, and `strict` policies.
- Updated the input form and README to accurately describe all supported routes, operators, and mixed-source batches.

### 0.2.3 — Scanned-PDF request-size safeguard

- Added bounded rendering and progressive JPEG compression for scanned-PDF visual extraction requests.
- Each rendered page is capped at 160 KB and each visual document batch at 1.2 MB before image encoding; documents that cannot fit safely receive an explicit, non-billable `SCANNED_PDF_PAGE_TOO_COMPLEX` or `SCANNED_PDF_TOO_COMPLEX` result rather than a provider payload rejection.
- Preserved safe prepared-document metadata in post-preparation error results to make support diagnosis clearer without exposing document content.
- Added regression coverage for detailed scanned PDFs and error metadata; the full suite passes with 155 tests and 87.23% coverage.
- Confirmed in Apify Cloud against the reported uploaded scan: it completed with schema-valid output and a `review` route, without the prior HTTP 413 failure.

### 0.2 — Public pricing clarity

- Corrected the public billing disclosure: Scalogik charges $0.02 for successful or partial document results plus $0.00005 per run; Apify OpenRouter model-token usage is billed separately to the account that starts a run.
- Clarified that no separate model-provider key is required, but managed token use is not included in the Scalogik event price.

### 0.1 — Private quality build

- Added managed schema-constrained extraction with no customer model key required.
- Added PDF, DOCX, XLSX, image, EML, CSV, JSON, HTML, Markdown, and text ingestion.
- Added local JSON-Schema validation, deterministic business rules, evidence verification, and workflow routing.
- Added SSRF protection, bounded downloads, token-safe URLs, fail-fast controls, and non-billable error records.
- Added cross-format fixtures and 149 automated tests with 88% branch-aware coverage.
