← all repositories
wxyhgk/retain-pdf

A full-stack pipeline that translates ugly PDFs without mangling them

It exists because most open-source PDF translators choke on scanned pages, inline formulas, and tables.

2.1k stars Python Other AI
retain-pdf
Not currently ranked — collecting fresh signals.
star history

What it does

RetainPDF ingests PDFs—especially scanned images and scientific papers—and translates them while attempting to keep the original layout, fonts, tables, and inline formulas intact. It is a decoupled full-stack system: a Rust API handles uploads, task scheduling, and artifact management, while a Python pipeline runs OCR normalization, translation, rendering, and final PDF assembly. The project ships as a desktop application, a web frontend, and Docker containers.

The interesting bit

The README explicitly positions RetainPDF as going “head-to-head with closed-source models,” claiming better output volume, speed, and font size control in some scenarios. Unlike many open-source alternatives that assume selectable text and simple layouts, this tool targets the miserable edge cases: image-based PDFs, complex inline math, and code blocks that should not be translated. The architecture is modular enough that developers can swap out OCR engines, translation providers, or rendering stages.

Key highlights

  • Handles scanned or image-based PDFs, not just text-selectable ones.
  • Attempts to protect complex inline formulas and code blocks from mistranslation.
  • Offers toggleable table control and rule-based custom translation strategies.
  • Claims strong layout preservation and continuous PDF compression optimization.
  • Provides a Rust API, Python processing pipeline, desktop app, and Docker deployment.

Caveats

  • The macOS desktop build currently lacks an Apple developer certificate, so the system may flag it as damaged on first open.
  • The React frontend is still in a migration area and does not yet replace the static production frontend.
  • The README’s performance claims against closed-source tools are stated without specific benchmarks or reproducible metrics.

Verdict

Researchers and developers drowning in scanned papers, technical manuals, or image-based PDFs should look here—particularly if they need an API-driven, self-hostable alternative to closed-source services. If you only translate clean, text-selectable documents, simpler tools may be less overhead.

Frequently asked

What is wxyhgk/retain-pdf?
It exists because most open-source PDF translators choke on scanned pages, inline formulas, and tables.
Is retain-pdf open source?
Yes — wxyhgk/retain-pdf is open source, released under the MIT license.
What language is retain-pdf written in?
wxyhgk/retain-pdf is primarily written in Python.
How popular is retain-pdf?
wxyhgk/retain-pdf has 2.1k stars on GitHub.
Where can I find retain-pdf?
wxyhgk/retain-pdf is on GitHub at https://github.com/wxyhgk/retain-pdf.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.