Skip to content
getnextpdf.com

Enterprise edition

Intelligence

NextPDF Enterprise Intelligence converts raw key-value and table data into typed, optionally schema-validated structures, and orchestrates searchable-PDF generation by driving an OCR backend over scanned pages. It describes the structures it produces; it does not assert OCR accuracy or extraction recall.

This capability ships in NextPDF Enterprise (nextpdf/enterprise) and activates with an Enterprise-tier license envelope. A deployment without that entitlement does not load the capability’s classes. A deployment without an active Enterprise entitlement does not load these classes. Compare editions and get a license.

Terminal window
composer require nextpdf/enterprise:^3

The structured extractor takes raw key-value pairs — produced upstream by an accelerator or a heuristic parser — and emits typed pair objects. When a schema is supplied, it keeps only the pairs whose key matches a schema field and reports which required fields are missing. A pair without an explicit confidence receives a fixed default. This is a typing and validation step over data that is already extracted; it is not itself an extraction or recognition engine and assigns no computed precision.

The table extractor takes raw row grids and builds structured table results with per-cell objects and synthesized, uniform bounding boxes derived by subdividing a normalized page area. Short rows are padded so every row has the widest column count. A table with no rows or no columns is skipped. The bounding boxes are a uniform grid synthesis, not a measured layout.

The searchable-overlay orchestrator accepts a scanned or mixed PDF, detects which pages lack a usable text layer, drives the configured OCR backend, and produces a result describing per-page word counts and an average confidence. Invisible text is the mechanism for a searchable scanned page: a text-showing operator can place glyphs while the text rendering mode is set so the text is neither filled nor stroked — ISO 32000-2:2020 §9.3.3 — and text-showing operators place glyphs in the content stream — ISO 32000-2:2020 §9.4. When the source is tagged, the logical-structure hierarchy maps content to a reading order — ISO 32000-2:2020 §14.7, tagged structure supports content reuse — ISO 32000-2:2020 §14.8, and table structure elements describe rows and cells — ISO 32000-2:2020 §14.8.

The actual rasterization and invisible-text injection are performed by a separate sidecar process; the PHP surface orchestrates the workflow and produces the result metadata. The output of an overlay run is a derived document: any existing signature is invalidated and compliance status requires re-validation. Confidence values are passthrough or fixed defaults, not a guaranteed accuracy figure.

The surface draws a hard line between structuring and recognition. Typing and schema validation run in-process, because they are deterministic and cheap. Recognition — rasterization and invisible-text injection — is delegated to an injected OCR backend and a separate sidecar, because it is heavy, backend-specific, and best kept outside the PHP trust boundary. That split lets a deployment choose where document images and recognized text are computed and stored, without changing calling code. The module also refuses to invent a precision figure: an unlabelled pair receives a fixed default, and reported confidence is passed through rather than computed. A caller is never handed a fabricated accuracy number.

Design background: An API that refuses to guess.

TypeKindRoleStabilitySince
StructuredExtractorclassTypes raw key-value pairs; schema filter and required-field checkstable2.2.0
ExtractionSchema / SchemaFieldclassesField definitions and required-field setstable2.2.0
KeyValuePairclassOne typed key-value pair with confidencestable2.2.0
TableExtractorclassBuilds structured tables from raw row gridsstable2.2.0
TableResult / TableCellclassesTable shape with per-cell text, confidence, and bounding boxstable2.2.0
SearchableOverlayclassOrchestrates OCR-backed searchable-PDF generationstable2.2.0
OverlayConfig / OverlayQualityclassesLanguage hint, DPI, quality preset, native-page skipstable2.2.0
SearchableOverlayResult / PageOverlayInfoclassesPer-page word counts and average confidencestable2.2.0
ExtractionConfig / ExtractionStrategyclassesHeuristic vs OCR-assisted strategy and OCR hintsstable2.2.0

The OCR backend is an injected contract. The orchestrator does not embed an OCR model; a deployment supplies the backend and is responsible for where OCR is computed.

Type and schema-validate raw key-value pairs
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use NextPDF\Enterprise\Intelligence\StructuredExtractor;
use NextPDF\Enterprise\Intelligence\ExtractionSchema;
/**
* Type raw pairs against a schema and list any missing required fields.
*
* @param list<array{key: string, value: string, confidence?: float}> $rawPairs Upstream key-value data.
*
* @return list<string> Missing required field names (empty when compliant).
*/
function validate(array $rawPairs, ExtractionSchema $schema): array
{
$extractor = new StructuredExtractor();
$pairs = $extractor->extract($rawPairs, $schema);
return $extractor->validateSchema($schema, $pairs);
}

The extractor types and filters data that an upstream step already produced. It performs no recognition itself.

Searchable-overlay orchestration with safe logging
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use NextPDF\Enterprise\Accelerator\OcrStrategyInterface;
use NextPDF\Enterprise\Intelligence\OverlayConfig;
use NextPDF\Enterprise\Intelligence\SearchableOverlay;
use Psr\Log\LoggerInterface;
final readonly class OverlayJob
{
public function __construct(
private OcrStrategyInterface $ocr,
private LoggerInterface $logger,
) {}
/**
* Generate a searchable PDF from a scanned input.
*
* @param string $pdfData Scanned or mixed PDF bytes.
*
* @return string The derived searchable PDF bytes.
*/
public function run(string $pdfData): string
{
try {
$result = (new SearchableOverlay($this->ocr))
->generate($pdfData, new OverlayConfig(language: 'eng'));
$this->logger->info('Overlay complete', [
'pages' => $result->pageCount,
'words' => $result->wordCount,
]);
return $result->pdfData;
} catch (\Throwable $e) {
$this->logger->error('Overlay failed', ['error' => $e->getMessage()]);
throw $e;
}
}
}

The log carries page and word counts only. It does not carry recognized text or the document bytes. The catch rethrows; it does not swallow the failure.

  • The structured and table extractors consume already-extracted data. They do not parse a PDF, run a model, or measure precision. Confidence is passthrough or a fixed default.
  • Synthesized table bounding boxes are a uniform grid subdivision, not a measured layout. A caller needing true geometry must obtain it elsewhere.
  • The searchable overlay is a derived document. Any existing digital signature is invalidated; compliance status must be re-validated after overlay.
  • When the OCR backend is unavailable, the affected pages contribute zero words rather than failing the whole run silently — check the per-page result.
  • A page that already has a usable native text layer is skipped by default. Disable the skip in the configuration if you must re-OCR.
  • OCR accuracy depends entirely on the supplied backend, the input quality, and the language hint. NextPDF does not assert recognition accuracy or extraction recall.

Structured and table extraction are linear in the input size. Searchable-overlay cost is dominated by the OCR backend and the sidecar’s rasterization at the configured DPI; the orchestration overhead is small. Page and size inputs are bounded and fail closed on overflow. The reproducibility profile is structural: extraction is deterministic for fixed input, while overlay output depends on the OCR backend and may vary between backends or versions.

The extractors are read-only structuring steps. The overlay surface produces a derived document and bounds input size and page count, failing closed on overflow. The OCR backend is an integration point, not part of the trust boundary; a deployment chooses and operates it. No cryptographic operation occurs in this module, so it makes no FIPS claim.

Structured and table extraction run in-process on the host. The searchable-overlay orchestration drives an injected OCR backend: where that backend runs — in-process, a local sidecar, or a remote service — and therefore where document images and recognized text are computed and stored, is a deployment responsibility outside the library’s boundary. If the input contains personal data, the recognized text layer will too; treat the derived document accordingly.

The library raises typed exceptions with structural messages and does not place document bytes or recognized text into exception text. A deployment that logs around this surface should log counts and configuration — as shown in the production sample — and must not log the raw PDF payload or the recognized text to logs or an APM backend.

No cryptographic operation occurs in this module, so there is no FIPS-mode-specific behavior.

ClaimStandardClause
Text rendering mode controls whether glyphs are filled, stroked, or neither (the basis for invisible OCR text).ISO 32000-2:2020§9.3.3
Text-showing operators place glyphs in the content stream.ISO 32000-2:2020§9.4
The logical-structure hierarchy maps content to a reading order.ISO 32000-2:2020§14.7
Tagged structure supports content reuse.ISO 32000-2:2020§14.8
Table structure elements describe rows and cells.ISO 32000-2:2020§14.8
The structure tree maps content to a reading order.ISO 32000-2:2020§14.7

All clauses are paraphrased. NextPDF does not reproduce normative text. Consult the published standard for the authoritative wording.

  • The structured and table extractors consume already-extracted data; they do not parse a PDF, run a model, or measure precision. Confidence is passthrough or a fixed default.
  • A schema filter keeps only pairs whose key matches a schema field and reports the missing required fields; synthesized table bounding boxes are a uniform grid subdivision, not a measured layout.
  • The searchable overlay is a derived document: any existing digital signature is invalidated and compliance status must be re-validated.
  • When the OCR backend is unavailable, affected pages contribute zero words rather than failing the whole run silently; a page with a usable native text layer is skipped by default.
  • Page and size inputs are bounded and fail closed on overflow. Extraction is deterministic for fixed input; overlay output depends on the supplied OCR backend.

This page documents externally observable behavior and the supported public API surface only. Internal namespace paths, helper classes, mechanism tables, runbook filenames, and ticket prefixes are out of scope.

NextPDF Core (Apache-2.0) has no searchable-overlay orchestration and no schema-validated structuring surface — none; this capability has no Core-tier equivalent. The Core AST model is the parsed-document base, not an extraction or OCR surface.

NextPDF Pro ships structural AST-driven extraction over an already-parsed document; it does not provide schema-validated key-value structuring, table reconstruction from raw grids, or OCR-backed searchable-overlay orchestration. Those ship in the nextpdf/enterprise package only.

The structured/table extractors and the overlay orchestrator are described at the behavior level. The actual rasterization and invisible-text injection run in a separate sidecar process; the sidecar internals, the OCR model, and any internal orchestration detail are out of scope for the public surface. The OCR backend is an injected contract supplied by the deployment.

The deployment supplies and operates the OCR backend and chooses where OCR is computed (in-process, a local sidecar, or a remote service) — and therefore where document images and recognized text are computed and stored. NextPDF Enterprise orchestrates the workflow and produces result metadata; it does not embed an OCR model or guarantee recognition accuracy or extraction recall.

No export-control restriction applies to the Intelligence surface. This documentation is not a legal opinion; consult your own compliance and legal advisers.