whatisgithub

What is retain-pdf?

wxyhgk/retain-pdf — explained in plain English

Analysis updated 2026-05-18

1,654PythonAudience · researcherComplexity · 3/5LicenseSetup · easy

In one sentence

RetainPDF translates PDF documents, especially scanned and scientific papers, while preserving the original layout, formulas, and structure instead of reflowing the text.

Mindmap

mindmap
  root((RetainPDF))
    What it does
      Layout preserving translation
      Scanned PDF support
      Formula rendering
    Tech stack
      Rust API
      Python scripts
      Docker
    Use cases
      Scientific paper translation
      Scanned document translation
      Team Docker deployment
    Audience
      Researchers
      Technical writers
      Students

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Translate a scientific paper PDF into another language while keeping formulas, tables, and layout intact.

USE CASE 2

Translate a scanned or image based PDF that other translation tools cannot handle cleanly.

USE CASE 3

Deploy a shared PDF translation service for a team using Docker.

USE CASE 4

Run the desktop app on Windows, macOS, or Linux for personal document translation.

What is it built with?

PythonRustDockerOCR

How does it compare?

wxyhgk/retain-pdfvasu-devs/justhirememayersscott/rkn-block-checker
Stars1,6541,7031,554
LanguagePythonPythonPython
Last pushed2026-06-12
MaintenanceMaintained
Setup difficultyeasymoderateeasy
Complexity3/53/52/5
Audienceresearchervibe codergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Prebuilt installers exist for Windows, macOS, and Linux, team or multi-device use is recommended via Docker compose instead.

You can use, modify, and distribute this software freely, including for commercial purposes, as long as you keep the original copyright notice.

So what is it?

RetainPDF is a tool for translating PDF documents while keeping the original page layout, formatting, and structure intact. It is aimed especially at scientific papers and technical documents, where formulas, tables, and diagrams need to stay in place after translation rather than being reflowed into a plain text block. The project pays particular attention to scanned or image based PDFs, which are much harder to translate cleanly than text based ones, since the layout has to be reconstructed from images rather than read directly from the file. It also focuses on rendering inline mathematical formulas correctly after translation, which many similar tools struggle with. According to the README's own comparison table, RetainPDF supports scanned PDFs, complex inline formulas, accurate code block handling, toggleable table detection, custom translation rule configuration, and continued PDF size optimization, in cases where some other tools it compares itself to do not. The system is split into a frontend and a backend, with OCR, translation, layout reconstruction, and file delivery handled as separate stages, so the pieces can be replaced or extended independently by other developers. For everyday use, prebuilt release packages are available for Windows, using a Setup.exe installer, for macOS, using a .dmg file, and for Linux, using a .deb package. Anyone wanting to run RetainPDF for a team, on a local network, or on several machines at once is pointed toward a Docker based deployment instead, using a provided docker compose configuration that starts a frontend, a Rust based API, and a file upload service on separate local ports. The backend combines a Rust API with Python scripts, reflecting the project's mixed language approach to handling OCR, translation, and layout work. The project maintains a community discussion group and public documentation covering setup, architecture, and its own planning notes for future work. RetainPDF is released under the MIT license.

Copy-paste prompts

Prompt 1
Help me set up RetainPDF using Docker compose and access it from my browser.
Prompt 2
Explain how RetainPDF handles translating a scanned PDF compared to a text based one.
Prompt 3
Walk me through installing the RetainPDF desktop app on macOS and fixing the damaged app warning.
Prompt 4
Show me how RetainPDF's frontend, Rust API, and Python scripts fit together in the architecture.

Frequently asked questions

What is retain-pdf?

RetainPDF translates PDF documents, especially scanned and scientific papers, while preserving the original layout, formulas, and structure instead of reflowing the text.

What language is retain-pdf written in?

Mainly Python. The stack also includes Python, Rust, Docker.

What license does retain-pdf use?

You can use, modify, and distribute this software freely, including for commercial purposes, as long as you keep the original copyright notice.

How hard is retain-pdf to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is retain-pdf for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.