Skip to content
TranBaDat2607Public

About

AI-powered PDF translator with intelligent research assistant. Multi-tool RAG agent autonomously searches PDFs, web & academic papers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PDFusion

Translate a PDF and keep it looking like a PDF.

Columns, tables, figures and page breaks stay where the author put them — then ask the document questions and get answers with page citations.

Release CI Platforms License


Most translators hand back a wall of text. PDFusion rebuilds the page: the translated text is laid back into the original layout, so a paper stays a paper and a form stays a form. It runs entirely on your machine, and the first translation works with no account, no API key and no internet — an offline English→Vietnamese engine ships inside the installer.

  • Nothing leaves your computer unless you choose a cloud model.
  • Bring your own model — OpenAI, Gemini, Claude, or anything OpenAI-compatible running on localhost.
  • Ask the document things — answers quote the pages they came from.

Download

⬇ Get the latest release

Platform File Install
Windows 10/11 (x64) PDFusion_<version>_x64-setup.exe Run it. Installs per user — no admin rights, nothing in Program Files.
Debian / Ubuntu (x64) PDFusion_<version>_amd64.deb sudo apt install ./PDFusion_<version>_amd64.deb

Two things everyone hits on first install:

  • Windows SmartScreen warns you. The installer is unsigned — a code-signing certificate costs money the project doesn't have yet. Choose More info → Run anyway.
  • Linux needs webkit2gtk 4.1, not 4.0. On Ubuntu: sudo apt install libwebkit2gtk-4.1-0 libgtk-3-0.

The download is large (several hundred MB) because the translation engine — layout models, fonts and the offline language pack, about 290 MB of it — ships inside so the app works on first run without downloading anything.

macOS builds from source but isn't packaged. An unsigned, un-notarized .dmg is refused by Gatekeeper with no useful way past it, so shipping one would be worse than shipping none (#69).

Quick start

  1. Open a PDF — Ctrl+O, or drop the file onto the window.
  2. Pick your languages in the From and To boxes. To defaults to Vietnamese.
  3. (Optional) Narrow the range in the Pages box — 1-10, 14, 22- all work. Leave it blank for the whole document.
  4. Press Translate. The translated pages appear beside the original as they finish; you can cancel mid-run.
  5. Press Save PDF… to keep it.

Step 5 is not optional. Until you save, the translated file lives in a temporary folder and is cleaned up. The app never writes over the PDF you opened.

Untranslated pages are copied through from the original, so what you save is always the whole document.

Translation services

Pick one in the toolbar. Only the first works offline.

Service API key Translates Notes
Argos Translate not needed English → Vietnamese Runs on your machine. The default, and what ships in the installer.
OpenAI yes any supported pair Also speaks to any OpenAI-compatible server.
Google Gemini yes any supported pair
Anthropic Claude yes any supported pair Also speaks to Claude-compatible servers.

Languages offered: Vietnamese, English, Japanese, Chinese (Simplified), Chinese (Traditional), with auto-detection for the source. PDFusion is Vietnamese-first, not Vietnamese-only — with an API key it translates between any of these pairs.

Add keys in Settings — they're encrypted before they touch disk. If you prefer a file, PDFusion also reads a .env from its data folder (see Where your data lives):

OPENAI_API_KEY=...
GEMINI_API_KEY=...
ANTHROPIC_API_KEY=...

If you select a cloud service with no key configured, PDFusion falls back to the offline engine rather than failing.

When a cloud model is selected, the toolbar shows an estimate of the tokens the run will use, so a 200-page document doesn't surprise you.

Use a compatible endpoint

The OpenAI and Claude tabs in Settings each have an Endpoint field, so PDFusion can go through a proxy, or another hosted service, that speaks one of those APIs. Leave it blank to use the provider itself. Then pick that service in the toolbar. Worth knowing:

  • Enter the key together with the endpoint. A saved key is only ever sent to the endpoint it was saved for, so changing the endpoint asks for the key again. An OPENAI_API_KEY or ANTHROPIC_API_KEY from your environment is only ever used with the provider itself.
  • Save checks the model with the endpoint first. If it can't be reached, Save shows the error and offers Save anyway.
  • The model field takes any name. The list beside it only makes suggestions.
  • Chat writes its answers with the same service and endpoint.

Chat with your document

Open the chat panel and ask about the PDF you have loaded. Every answer cites the pages it came from as [p. 7] links; click one to jump there. Each document keeps its own conversation, which you can clear.

Chat answers from exactly one document — the one you have open — so it never blends two papers together.

How it works: retrieve by text, read by vision.

  • Indexing is local and free. Text is split into paragraph chunks under their section headings, tables are read as tables, and scanned pages are OCRed on your machine.
  • Finding the pages is local and free too. Keyword and semantic search are fused, and the results are grouped into pages.
  • The answer is one model call. It reads those pages, and is shown images of up to three of them (charts, tables, scans), so it can read what the text layer can't.
  • Citations are checked. A page the model wasn't shown never becomes a link.

Experiment design. The chat benchmark compares this version with the previous one, run from the commit before the redesign. Both use the same answer model, Gemini 2.5 Flash-Lite.

  • Documents:
    • A synthetic 14-page annual report, with known answers on every page: prose, ruled tables, charts whose numbers exist only in the image, scanned pages, a Vietnamese page, and distractor pages that share a question's words but not its answer.
    • The paper Attention Is All You Need, plus a scanned copy of it with no text layer.
    • A 57-page document combining these with two more papers, to measure how cost grows with length.
  • Questions: 43 on the first three documents, plus 6 on the long one. They are tagged text, table, chart, figure, scan, multilingual or unanswerable, and each lists every page that states its answer.
  • Scoring:
    • Retrieval: whether a correct page is ranked first.
    • Answers: whether the expected values appear, with citations stripped first so a page number can't pass for a value. An unanswerable question counts as correct when the answer says so.
    • Citation precision: the share of cited pages that state the answer.
    • Cost: model calls and tokens per question.
    • Time: seconds per question, on a CPU-only machine.
Correct answers Citation precision Right page ranked first Model calls / tokens per question Time per question
Previous version 0.47 0.20 0.62 2.4 / 1,003 2.6 s
PDFusion 0.93 0.97 0.85 1 / 2,925 2.2 s

Charts went from 0.00 to 1.00, and scanned pages went from not indexable at all to the right page ranked first 91% of the time. The cost per question doesn't grow with the document: about 2,400 tokens on the 57-page PDF.

First use downloads about 120 MB — a multilingual embedding model, fetched once into ~/.cache/huggingface. Everything after that is local. This is the only part of PDFusion that needs the internet when you're using the offline translator.

Keyboard shortcuts

Ctrl+O Open a PDF
Ctrl+F Find in document
F3 / Shift+F3 Next / previous match
Ctrl + / - / 0 Zoom in, out, reset

Where your data lives

Everything stays on your machine.

Windows Linux macOS
Settings, cache, chat index %LOCALAPPDATA%\PDFusion ~/.local/share/PDFusion ~/Library/Application Support/PDFusion
Logs …\PDFusion\logs …/PDFusion/logs …/PDFusion/logs
API keys protected by DPAPI, scoped to your account Secret Service (gnome-keyring, KWallet) Keychain

Translations are cached, so re-translating the same document is quick. You can clear the cache from Settings.

On Linux with no keyring running — a bare tiling-WM setup, a container — keys fall back to an obfuscated value in config.toml that anyone who can read the file can recover. PDFusion says so in app.log rather than refusing to start. Install and unlock gnome-keyring or kwalletmanager if that matters to you.

Troubleshooting

Windows says the app is unsigned. It is. More info → Run anyway. See Download.

The first translation is slow. The engine loads its layout models on first use. Later runs reuse them, and repeat documents come from the cache.

Chat won't start. It needs that one-time 120 MB model download — check your connection and app.log.

A PDF won't open or looks wrong. Scanned pages with no text layer can't be translated; there's no OCR step yet. Please open an issue with the file if you can share it.

Where are the logs? The boot screen has a Show logs folder button, which opens the right directory for your platform.

Building from source

See docs/development.md for prerequisites, setup and how to build an installer, and docs/architecture/ for why the app is put together the way it is.

Issues and pull requests are welcome.

License

MIT.

Built on BabelDOC for layout-preserving translation and Argos Translate for the offline engine.

About

AI-powered PDF translator with intelligent research assistant. Multi-tool RAG agent autonomously searches PDFs, web & academic papers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages