Papers
Topics
Authors
Recent
Search
2000 character limit reached

BabelDOC: Better Layout-Preserving PDF Translation via Intermediate Representation

Published 11 May 2026 in cs.CV and cs.CL | (2605.10845v1)

Abstract: As global cross-lingual communication intensifies, language barriers in visually rich documents such as PDFs remain a practical bottleneck. Existing document translation pipelines face a tension between linguistic processing and layout preservation: text-oriented Computer-Assisted Translation (CAT) systems often discard structural metadata, while document parsers focus on extraction and do not support faithful re-rendering after translation. We introduce BabelDOC, an Intermediate Representation (IR)-based framework for layout-preserving PDF translation. BabelDOC decouples visual layout metadata from semantic content, enabling document-level translation operations such as terminology extraction, cross-page context handling, glossary-constrained generation, and formula placeholdering. The translated content is then re-anchored to the original layout through an adaptive typesetting engine. Experiments on a curated 200-page benchmark, together with human evaluation and multimodal LLM-as-a-judge evaluation, show that BabelDOC improves layout fidelity, visual aesthetics, and terminology consistency over representative baselines, while maintaining competitive translation precision. The open-source toolkit and its interactive downstream applications are publicly available and have attracted over 8.4K GitHub stars and 17 contributors at the time of writing. A demonstration video is also available.

Summary

  • The paper introduces an intermediate representation framework to decouple text semantics from layout metadata, enabling layout-preserving PDF translation.
  • It demonstrates superior layout fidelity and semantic consistency with a BIoU of 50.0% and high human evaluation scores in key metrics.
  • The method supports modular integration with robust handling of complex structures like formulas, tables, and graphics.

Intermediate Representation-Centric PDF Translation with BabelDOC

Motivation and Problem Setting

The dominance of PDFs in global knowledge dissemination, especially within STEM literature and technical domains, poses significant challenges for cross-lingual access due to the complex interplay between linguistic translation and the preservation of intricate layout structures. Traditional machine translation and CAT pipelines, designed for linear text, systematically compromise visual integrity by discarding structural metadata, whereas document parsers offer unidirectional PDF-to-text conversion but lack support for faithful re-rendering post-translation. Consequently, layout degradation, semantic truncation, and terminology inconsistency pervade output from both commercial and open-source PDF translation systems.

BabelDOC ["BabelDOC: Better Layout-Preserving PDF Translation via Intermediate Representation" (2605.10845)] addresses these limitations by introducing a modular, Intermediate Representation (IR)-based framework. The IR paradigm enables decoupling between text semantics and layout metadata, thus supporting fine-grained, document-level NLP interventions without sacrificing typographical precision.

System Architecture: Decoupled NLP and Layout with Intermediate Representation

The core architectural innovation in BabelDOC is the explicit separation of text from layout via a structured, bidirectional IR. The pipeline parses the input PDF, extracting all per-page visual and structural elements—characters, text blocks, formulas, graphic objects, and spatial metadata—into the IR. This IR acts as an editable substrate upon which advanced NLP and translation tasks occur, before adaptive re-integration into a visually faithful PDF output.

Figure 1

Figure 1: The system architecture of BabelDOC, which splits raw PDF parsing, document-level NLP, and adaptive layout reconstruction using an intermediate representation for robust, layout-preserving translation.

Key modules include:

  • Decoupled Intermediate Representation: Captures each visual element—text, formulas, images—along with spatial and typographic attributes, enabling manipulation at both semantic and rendering levels.
  • Formula and Multimodal Placeholdering: Employs a specialized detection and offset calculation pipeline to mask mathematical notation and structured fragments during NLP, preventing corruption by LLMs and ensuring accurate vectorized reconstitution.
  • Semantic Engine and Contextual Translation: Facilitates document-level operations such as dynamic glossary extraction, customized prompt injection for terminology constraint, and cross-page/column context handling, exploiting the IR for accurate context aggregation.
  • Adaptive Typesetting Mechanism: Iteratively computes localized scaling factors to address typographic expansion in target languages, maintaining the visual arrangement within original layout bounds.
  • Nested Structure and CTM Reconstruction: Preserves visual integrity by handling complex PDF nesting, including XObject stacks, matrix transformations, and clipping paths, yielding high-fidelity reconstruction even under dense visual nesting.

Evaluation Methodology and Quantitative Results

The evaluation spans a curated benchmark of 200 complex PDF pages divided among scientific literature, technical documentation, and international patents, measuring layout preservation and semantic consistency versus state-of-the-art baselines (DeepL, PDFMathTranslate). Metrics include BIoU for geometric layout accuracy, multidimensional Likert scores (Layout Fidelity, Translation Precision, Visual Aesthetics, Terminology Consistency), and untranslated block count. Human evaluation (by bilingual annotators) is complemented by an LLM-as-a-Judge protocol using Gemini-2.5-Flash with explicit rubrics and block detection.

BabelDOC achieves a BIoU of 50.0%, outperforming previous open-source and commercial systems by a significant margin in layout preservation. Human annotators report scores of 4.59 (LF), 4.28 (TP), 4.46 (VA), and 4.47 (TC), with fewer terminology errors and substantially improved visual aesthetics relative to the baselines. LLM-based evaluations corroborate these trends.

Qualitative analysis highlights BabelDOC’s strengths in reconstructing multi-line equations, table structures, figure text, and consistent translation of domain-specific terminologies. The ablation study isolates the contributions of adaptive typesetting—4.50 LF/VA with, versus 3.00/2.50 without—and shows that document-level glossary/context modules are critical for maintaining terminology consistency.

Figure 2

Figure 2: BabelDOC’s translated pages retain complex tables, formulas, fonts, and consistent terminology, addressing both layout and semantic deficiencies of prior methods.

Implications and Prospects for Cross-lingual Document Intelligence

The IR-centric design of BabelDOC fundamentally transforms PDF translation workflows. By externalizing structural and semantic data as a mutable schema, BabelDOC enables:

  • Modular integration of new OCR and LLM backends as they emerge, without reengineering the core typesetting system.
  • Fine-grained control over terminology, context, and rendering, facilitating consistent, high-quality output for domain experts and enhancing downstream usability (e.g., bilingual literature, technical manuals).
  • Development of extensible open-source tools, with an accessible ecosystem (CLI, GUI, Python APIs) already adopted by a growing community.

Practically, BabelDOC alleviates language barriers in open science access, technical transfer, and patent examination while preserving the artifacts’ functional and visual fidelity. Theoretically, it presents a blueprint for multimodal document translation where structure and semantics are first-order citizens, and opens the way for future research on real-time collaborative editing, robustness to unconventional layouts, and support for languages with radical morphological or typographic differences.

Conclusion

BabelDOC establishes an effective paradigm for layout-preserving PDF translation by leveraging a bidirectional intermediate representation. The system demonstrates substantial gains in layout fidelity, semantic control, and extensibility over both commercial and academic baselines. Empirical results substantiate the claim that robust IR-based manipulation enables consistent, controllable translation outputs for visually complex documents. The approach has broad implications for the development of document intelligence frameworks that demand both translation quality and uncompromising visual integrity.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 1 like about this paper.