Engineering Journal
Pdf Processor
Pdf Processor

Borrowed Math, Original Niches: What's New When the Algorithms Aren't

2026-05-30

TLDR

Building a browser-native PDF extraction engine involves minimal mathematical innovation: lattice intersection algorithms, Y-band clustering, and XY-cut partitioning have existed in academic literature since the 1980s. Originality lies in architectural constraints: executing the entire pipeline client-side inside Web Workers on top of PDF.js, enforcing non-overlapping region invariants, and enabling per-page streaming.
Architectural DimensionTraditional Python Extraction ToolsClient-Side Web Worker Pipeline
Execution EnvironmentServer-side Python runtimeClient-side Web Worker threads
Data PrivacyRequires uploading PDF bytes to server100% On-device processing (Zero server transit)
Memory IsolationSingle-threaded backend processNested Web Workers with page streaming

What is borrowed vs. What is novel

Standard industry primitives (borrowed)

Architectural innovations (novel)


Technical architecture: non-overlapping text indices

Prevent multi-stage classifiers from double-claiming text using a shared assignedTextIndices bitset:

export class DocumentExtractionContext {
  constructor(textItems) {
    this.textItems = textItems;
    this.assignedIndices = new Set();
  }

// Retrieve only unclaimed text items for downstream classifiers getUnclaimedItems() { return this.textItems.filter((_, idx) => !this.assignedIndices.has(idx)); }

// Claim items once a classifier claims a region claimItems(claimedItemIndices) { claimedItemIndices.forEach(idx => this.assignedIndices.add(idx)); } }

By maintaining this invariant across stages (Lattice $\rightarrow$ Stream Table $\rightarrow$ Column Split $\rightarrow$ Paragraph), downstream detectors never receive items already owned by earlier stages.

Rule of thumb: Define product novelty by your architectural constraints and negative space, what you refuse to build, rather than expecting core mathematical primitives to be unique.
Read this post in the full Engineering Journal →