Xberg review: PDF tables, OCR and partial failures

Testing Xberg 1.3.9, the successor to Kreuzberg, on native and scanned PDFs: exact table cells, mixed pages, OCR numeric errors and batch failure handling.

AgentIndex · Published 2026-11-07 · Updated 2026-11-07

Xberg, the successor to Kreuzberg, extracted our native PDF table correctly and recovered text from the tested English scans when configured with Tesseract. The harder scanned table also produced missing rows and incorrect numbers. An extraction result was therefore useful input for a document pipeline, but insufficient evidence that a table was safe to import without checks.

We made 15 real Python extraction calls using the published Xberg 1.3.9 native wheel. This review asks a specific adoption question: what must a pipeline check when native text, scanned pages and failed documents arrive together?

Xberg 1.x and Kreuzberg 4.x are separate version lines

The fixed release README identifies Xberg as the next iteration of Kreuzberg, rebuilt under a fresh v1 line. The current repository is xberg-io/xberg; the Kreuzberg v4 LTS repository remains separate. At the time of this review, the Python distributions were xberg==1.3.9 and legacy kreuzberg==4.10.4. We executed the former only.

The tested public Python API exposed extract, extract_batch and ExtractInput. It did not expose extract_file_sync. Existing Kreuzberg examples should therefore be checked against the chosen version; this was not a drop-in migration test. We retain the directory's existing tool URL so readers searching either project name reach the same reviewed record.

What actually ran

The environment was macOS 26.6.2 on Apple M1 Pro, running x86_64 Python 3.13.1. We installed the binary distribution with a three-package lock: Xberg 1.3.9, pypdf 7.0.0 and Pillow 13.0.0. The wheel was xberg-1.3.9-cp310-abi3-macosx_11_0_x86_64.whl, SHA-256 8e1ea84e5cfbeeec3c13957584754c45ae1b29bfd5e4ea5ebca222fe84ae3552. Four Python wrapper files matched release commit fdb16150ed0bf8578d68e20ec32301bc2caa8fd1; the installed native binary matched the verified wheel.

We used five unchanged synthetic PDFs from that commit: a blank page, a native table, a simple scan, a two-page native/scan mixture and a dense shaded scan. These are upstream test fixtures, not a representative customer corpus or real financial filings. We independently rendered all six pages with Poppler and visually checked them; pypdf supplied a separate text-layer control. A small Chinese HTML document was our own additional specimen.

The reproduction scripts, hashes and raw results retain the inputs' fixed URLs, returned content, table cells, page content and expected failures. The English tessdata_fast file was also pinned and hashed. The system Tesseract CLI reported 5.5.0; that is an environment observation, not a separately established version of Xberg's embedded backend.

ConditionObserved behavior
Native table, OCR disabledOne table; all 20 cells matched the visual reference
Same native PDF supplied as bytesContent and table data matched the file input
Image-only simple scan, OCR disabledSuccessful result with empty content
Same scan, explicit Tesseract English configurationAll three selected text markers appeared
Mixed native and scanned pagesNative text retained; configured OCR recovered page two in order
Dense shaded scanTwo of five selected rows had all six numeric values correct
Corrupt PDF in a single callRaised RuntimeError with a parsing error
Valid and corrupt PDF in one batchOne valid result and one indexed error

The calls used the native PDF backend, table extraction, page extraction, disabled cache and a 30-second extraction deadline. OCR cases explicitly selected Tesseract, eng data and disabled VLM fallback. This was not a test of unspecified default OCR configuration. No model service or remote-document endpoint was used. Python TCP auditing recorded no connection attempts; that audit does not observe every possible native-library network path.

Native table cells survived both input paths

The native fixture contained a four-column table: a header and four yearly rows. With OCR disabled, Xberg returned exactly one table whose 20 cells matched the reference, including comma-separated numbers and the multiword header. Supplying the same bytes through ExtractInput(kind="bytes", ...) produced identical content and tables.

This is a concrete positive result for a small, clean text-layer table. It does not establish coverage for merged cells, rotated tables, multi-page layouts or arbitrary reports. We also ran a forced-OCR configuration on that PDF; its table matrix matched, but we cannot attribute that table entirely to OCR because the pipeline still had access to the native PDF structure.

An additional chunking call, configured with max_characters=180 and overlap=30, returned five nonempty chunks. We checked their presence, not retrieval quality, semantic boundaries or a general chunk-size guarantee.

Mixed pages need explicit OCR and page checks

pypdf found no text layer in the simple scan. Xberg with OCR disabled returned one result, zero errors and empty content. With the explicit English Tesseract configuration, the selected heading, secondary line and invoice-number marker appeared, and metadata reported OCR use.

The two-page fixture made the routing distinction clearer. Its first page had selectable text; its second page was image-only. With OCR disabled, the native page appeared and the scanned-page marker did not. With OCR configured, both appeared in page order, including the selected total on page two. Page extraction returned two page records. Setting force_ocr_pages=[2] also preserved the native first-page marker and recovered the second-page marker.

The blank PDF separately returned a successful empty result. Empty content can consequently mean a valid blank page or an unprocessed scan in these conditions; it is not interchangeable with a parsing exception. Ingestion code should combine document expectations, per-page output and OCR metadata before deciding whether to accept, retry or review a document.

A structured scanned table can still contain wrong numbers

Before extraction, we visually transcribed five rows of the shaded scan, each with six values. Row labels were normalized for matching; numeric comparison removed commas and whitespace only, preserving signs, parentheses and decimal points. The audit was deliberately stricter than checking that a table object existed.

Selected rowAll six values matched?Finding
APPLESYesSix values matched
SUBTOTAL FRUITNoLabel not found among returned table rows
TOTAL PRODUCEYesSix values matched
SPOILAGENoLabel not found among returned table rows
CLOSING STOCK BALANCENoTwo numeric values differed

For the last row, expected 30,640 became 30,604, and expected 29,408 became 29,749. Those are consequential changes for a numeric import even though the response contained structured cells. The raw extraction is retained so readers can inspect more than the chosen rows.

There is an input caveat: Poppler rendered this fixture successfully but warned about a malformed JP2 stream before falling back to J2K. We preserve that warning alongside the visual check. It limits what this one specimen says about general OCR behavior; it does not remove the observed mismatch. Two of five selected rows matching is a result for this selected check, not a whole-document OCR accuracy rate or an estimate for other documents.

For numeric ingestion, validate expected row labels and column counts, reconcile totals where meaningful and route disagreements to visual review. The pipeline's success flag and a populated table are insufficient acceptance criteria for this tested scan.

Single-call and batch failures need different handling

We supplied deliberately broken PDF bytes. extract raised RuntimeError with an invalid cross-reference-table parsing message. A nonexistent local path separately raised RuntimeError with an I/O error.

Passing one valid table PDF and the same corrupt bytes to extract_batch returned normally, with summary counts inputs=2, results=1, errors=1. The error identified input index 1, while the valid table remained exact. The batch therefore preserved useful work, but a caller checking only for an exception would miss the failed input.

Handle both raised exceptions and returned batch errors, and retain the mapping to source inputs. Treat empty successful content as a separate outcome. These are observed contracts for the tested cases, not a survey of every possible failure code.

Where this result supports adoption

Xberg is worth a pilot when you want a local extraction library with native PDF text, tables, optional OCR and per-input batch error reporting, and can add document-specific acceptance checks. The reviewed Python package declares Python 3.10 or newer. Our binary-only installation and pip check passed on the stated environment; other platforms were not run.

Chinese markers survived the artificial HTML extraction and its script marker was absent. That checks static HTML handling, not Chinese OCR. Only English OCR data was used. We did not test Office files, the full format list, multilingual scans, embeddings, VLMs, other language bindings, CLI/MCP servers, large-file memory use, production throughput or a speed advantage over alternatives.

See the Xberg tool profile for setup and selection notes. If you expose extraction through a Python MCP server, the FastMCP validation and timeout review explains why application contracts still matter. For a later context-processing step, our Headroom review distinguishes compression from preservation of source content.