Engineering Journal
Pdf Processor
Pdf Processor

Mapping the 2x2 of Frontend PDF Extraction (And the Empty Quadrant)

2026-05-30

TLDR

Browser-based PDF processing architectures map onto a $2\times2$ design space defined by Execution Mode (Backend vs. Frontend Browser-Native) and Structural Strategy (Deterministic Geometry vs. Machine Learning Models). While backend engines (pdfplumber, Camelot) and visual canvas viewers (pdf2htmlEX) populate three quadrants, the Deterministic-Structural-Frontend quadrant remained empty until modern Web Worker CTM operator pipelines filled the gap.
Quadrant CategoryRepresentative StackEngineering Tradeoff
Backend Deterministicpdfplumber, Camelot, PyMuPDFRequires server infrastructure / API costs
Frontend Visual Canvaspdf2htmlEX (WASM)Absolute <div> positions; zero semantics
Frontend ML Inferencetransformers.js + LayoutLMHeavy model weights ($6\text{MB}+$); slow inference
Frontend DeterministicCTM Operators + Geometry WorkersZero ML weights, 100% Browser-native structure

Technical comparison matrix

// Baseline PDF.js extraction used by 95% of naive implementations:
// Fails on multi-column papers, tables, and structured document reflow
const pdf = await pdfjsLib.getDocument(bytes).promise;
let text = '';
for (let i = 1; i <= pdf.numPages; i++) {
  const page = await pdf.getPage(i);
  const content = await page.getTextContent();
  text += content.items.map(it => it.str).join(' ') + '\n';
}
Rule of thumb: Combine vector operator list parsing with browser Web Workers to execute deterministic structural PDF layout extraction without server dependencies or ML model weights.
Read this post in the full Engineering Journal →