An Agentic Framework for Visually Faithful Document Reconstruction
PDFs preserve layout, typography, and visual styling — but that fidelity vanishes when converted to the web. Existing tools recover text and structure yet discard physical layout, color, and positioning. REPLICA reconstructs documents into web-native HTML that preserves BOTH semantics AND visual appearance.
While PDF remains the standard for digital documents, it integrates poorly with web-native environments. Existing document-to-HTML systems prioritize text accuracy and logical structure while discarding physical structure — typography, color, and precise spatial organization. REPLICA is an agentic document-to-HTML framework that generates visually faithful, layout-aware, semantically enriched HTML we call FID-HTML. It uses a four-stage pipeline — Segment, Localize, Assemble, Refine — and generalizes across diverse document types and multiple languages. For evaluation we introduce VFDR-Bench, spanning 22 languages and 17 domains with high-fidelity FID-HTML annotations. REPLICA achieves 93% visual fidelity, outperforming strong baselines including GPT-5 and Gemini-2.5-Pro. Notably, REPLICA with Qwen3-VL-8B achieves a 39% overall gain over Qwen3-VL-30B despite being 3.75× smaller at comparable inference time — showing structured agentic design beats brute-force scale.
A high-fidelity, semantically enriched HTML representation that encodes six complementary dimensions of a document.
FID-HTML is a high-fidelity, semantically enriched HTML representation that jointly preserves content, structure, geometry, and visual styling. Unlike generic HTML which merely permits visual fidelity, FID-HTML guarantees it by encoding six complementary dimensions. It serves as both the canonical ground-truth format for VFDR-Bench and the target output of REPLICA, enabling downstream tasks like layout-preserving translation, grounded document intelligence, and semantic chunking for RAG.
"Facts of Life" — scanned magazine fact sheet (input page).
This is the real Fid-HTML source of the page on the left. Click a dimension to spotlight exactly where it lives in the code — flip to Rendered to see this exact markup drawn by your browser (the text is real and selectable).
T.E. Text Extraction · L.S. Logical Structure · P.S. Physical Structure · V.F. Visual Fidelity · R.O. = Reading Order, L.H. = Layout Hierarchy.
A Visually-Faithful Document Reconstruction benchmark with high-fidelity FID-HTML annotations.
A four-stage agentic pipeline transforms a document page into visually faithful FID-HTML.
Pick a document, then step or play through REPLICA's four stages. Intermediate outputs are pre-computed — no live inference.
On VFDR-Bench — 5,000 documents across 22 languages and 17 domains.
NTED↓ is lower-is-better; all other columns are higher-is-better. Best value per column in accent.
Original document (left) vs. REPLICA's reconstruction (right). The right panel is the actual FID-HTML rendered live — try selecting the text: it's real, not an image.
FID-HTML unlocks layout-aware document intelligence. Hover an application to zoom into it — click to pin.