Vetrenar411 downloadsTranslate PDF documents with overlay, supports OpenRouter, OpenAI, Gemini, Ollama, and custom endpoints. Includes layout detection, and persistent storage of translations..
An Obsidian plugin that translates PDF documents directly inside your vault. Translated text is displayed as a transparent overlay on top of the original PDF, or written to a separate Markdown note for scanned documents.
| Component | Required for |
|---|---|
| Obsidian 1.4+ | All features |
| An API key (OpenRouter, OpenAI, Gemini) or local Ollama | Translation |
Python 3.8+ with pymupdf (pip install pymupdf) |
Python layout engine, background translation, PDF export |
The Internal layout engine works without Python — it reads the text layer already rendered by Obsidian's PDF viewer. Use Python for better layout accuracy or for background/headless translation.
The translated text appears as a coloured overlay on top of the original. Scroll to another page and run the command again, or use "Translate multiple pages…" to process a range at once.
.translations.md file in your vault. The next time you open the PDF, overlays load instantly without re-translating.For PDFs with no text layer, a different pipeline is used. See OCR (Ai Vision)
Choose the engine in Settings → Layout Engine.
Reads the text layer that Obsidian's built-in PDF.js renderer produces. Works out of the box with no extra dependencies.
Runs layout_engine.py (a bundled script) using your local Python installation. PyMuPDF reads the PDF directly from disk without the browser renderer.
pip install pymupdf.Setup:
/usr/bin/python3).Note: The Python engine is the only one that supports headless background translation via the Folder Watcher, because it reads the file from disk rather than from the browser's DOM.
Go to Settings → Translation Provider to configure which AI service handles translation.
| Provider | Notes |
|---|---|
| OpenRouter | Aggregates hundreds of models. Recommended for the widest model choice. Free tier available. |
| OpenAI | GPT-4o, o1, o3, and others. Requires a paid API key. |
| Google Gemini | Gemini Flash, Pro, etc. Free quota available. |
| Ollama | Runs models locally — no API key needed, full privacy. Requires Ollama running on your machine. |
| Custom Endpoint | Any OpenAI-compatible API. Supply the URL, key, and model name manually. |
Model lists are fetched live from each provider. Click Refresh (⟳) after entering your key to populate the dropdown. If your model isn't in the list, type its exact ID in the Model ID (manual) field — this always takes precedence.
Controls how deterministic the output is. 0.0 = always picks the highest-probability token (best for translation consistency). 1.0 = more creative/varied. Default is 0.3.
For scanned PDFs or image-only PDFs that have no text layer, use the OCR subsystem. It is independent from the Layout Engine — you can keep Python for normal PDFs and run OCR on scans at the same time.
The OCR model can be different from the translation model. Configure it in Settings → OCR (AI Vision). Supported providers: OpenRouter, OpenAI, Google Gemini, Ollama, Custom.
Each recognized note has this structure:
---
pdf-source: "[[path/to/document.pdf]]"
ocr-model: google/gemini-flash-1.5
target-language: Russian
generated: 2026-06-01T12:00:00Z
---
# document — translation
<!-- ocr-page:1 -->
## Page 1
[[path/to/document.pdf#page=1|→ page 1]]
Translated text of page 1…
<!-- ocr-page:2 -->
## Page 2
…
Running OCR on a page that already exists in the note overwrites only that page's section — the rest of the note is untouched. Pages always stay in order regardless of what order they were recognized.
Tip: For the best recognition quality, set Image Scale to 2 or higher in OCR settings, and choose a vision model with strong OCR ability
The Folder Watcher monitors a vault folder for new PDFs and queues them for background translation. Requires the Python layout engine — Python is the only engine that can extract text from a file without opening it in a tab.
The watcher never starts a translation automatically. Detection only queues files; you trigger translation manually from the queue.
Open the queue with the command "Background translation: open watched-folder queue" or the button in Settings.
Click Translate on a single item or Run all pending to process the whole queue sequentially.
Scan folder now checks the watched folder for existing PDFs that don't yet have a translation file and adds them to the queue.
The output is the same as a normal Python overlay translation: a .translations.md file saved according to your storage location setting. When you open the PDF, overlays load from this file instantly without re-translating.
Open the command palette (Ctrl/Cmd + P) and search for any of these commands.
| Command | What it does |
|---|---|
| Translate and add overlay to current PDF page | Translate the currently visible page and show the overlay. Main command — assign a hotkey. |
| Translate multiple pages… | Open a dialog to translate a range of pages with progress and cancel. |
| Save current PDF overlay | Manually save the current page's overlay data to the .translations.md file. |
| Refresh current PDF overlay | Reload overlay data from the file (useful after editing the file externally). |
| Clear current PDF overlay | Remove all overlays from the current page (does not delete the file). |
| Toggle PDF overlay visibility | Show or hide all overlays on the current PDF without removing them. |
| Reprocess/retranslate a text region… | Retranslate a specific text block (useful for fixing a bad translation). |
| Retranslate using saved overlay layout… | Re-run translation using the previously saved segment layout. |
| Command | What it does |
|---|---|
| OCR: recognize PDF to translated note (choose pages)… | Open the OCR dialog with page range selection, progress, and cancel. |
| OCR: recognize current page to translated note | Recognize the current visible page and write/update its section in the note. |
| Command | What it does |
|---|---|
| Background translation: open watched-folder queue | Open the queue of detected PDFs. |
| Command | What it does |
|---|---|
| Rebuild PDF-to-translation file map | Rescan the vault and rebuild the index that links PDFs to their .translations.md files. Run if overlays stop loading after moving files. |
| Clean unused translation files… | Find and optionally delete .translations.md files whose source PDF no longer exists. |
| Export PDF with translations | Permanently embed the current page's translation into a new PDF file. |
| Command | What it does |
|---|---|
| Adjust Layout Detector Settings… | Fine-tune how the plugin groups text blocks into translation units. |
| Layout: Quick switch preset… | Switch to a predefined layout preset. |
| Toggle BBox Edit Mode | Enable dragging overlay boxes to correct their positions. |
| Toggle Layout Parser Debug Mode | Show layout parsing diagnostics for troubleshooting. |
Configure the AI model used for translation text. Each provider has its own model list and API key field.
0.0–1.0. Default 0.3. Lower = more consistent terminology. Higher = more varied phrasing.| Setting | Default | Description |
|---|---|---|
| Source Language | English | Language of the PDF text |
| Target Language | Russian | Language to translate into |
| Translation Storage Location | (empty) | Folder for .translations.md files. Empty = next to each PDF |
| Auto-Save Overlay Data | On | Save overlay data automatically after translating a page |
| Merge Split Sentences | On | Rejoin sentences split across lines before sending to the API (Internal engine only) |
| Delay Between Requests | 150 ms | Pause between sequential requests — increase for free-tier rate limits |
| Setting | Description |
|---|---|
| Enable Watcher | Start watching for new PDFs |
| Watched Folder | Vault-relative path. Non-recursive (subfolders are not watched) |
Read the help text in the settings panel before editing prompts — it explains placeholders and the rules that keep batch translation aligned.
In short:
[#1], [#2]… segments and must return them with the same tags. Do not remove {lineCount} or the [#N] instructions.{TEXT}. Overrides both prompts above when enabled.| Setting | Description |
|---|---|
| Layout Engine | Internal or External Python script (PyMuPDF) |
| Python Interpreter Path | Path to python3 (e.g. /usr/bin/python3) |
| Layout Script Path | Path to layout_engine.py (auto-filled after Install) |
| Install / Update Scripts | Write bundled scripts to the plugin folder |
| Setting | Description |
|---|---|
| OCR Provider / API Key / Model | Independent from the translation provider |
| Recognized Files Folder | Where to save OCR notes. Empty = next to the PDF |
| Filename Pattern | Template for the note name. Placeholders: {pdfname}, {date} |
| Transcription Prompt | The instruction sent to the vision model |
| Image Scale | Resolution multiplier for page capture. 2 recommended |
| Setting | Description |
|---|---|
| PDF Export Script Path | Path to pdf_export.py |
| Test Setup | Verify Python and PyMuPDF are working |
The export renders a white background behind each translated block and uses each block's own text color. Additional rendering options (font scale, color per block) are set per-export in the export dialog.
Each translated PDF gets a companion file: <pdfname>.translations.md (or <pdfname>.translated.md for OCR notes). These files live next to the PDF by default, or in the folder you specify in Translation Storage Location.
.translations.md)---
pdf-source: "[[path/to/document.pdf]]"
timestamp: 2026-06-01T12:00:00Z
format-version: 3
---
The rest of the file contains serialized overlay position data. Do not edit this file manually unless you know what you're doing — it will be overwritten on the next translation.
The pdf-source field uses a wiki-link so Obsidian graph view shows the relationship between the PDF and its translation file. If you move or rename a PDF, run "Repair translation links" to update the link.
Export PDF with translations permanently embeds the overlay text into a new PDF file using PyMuPDF. The original PDF is not modified — a new file is created.
Requirements: Python + pip install pymupdf.
Setup:
.translations.md file exists and its pdf-source field points to the correct PDF path. If the PDF has an apostrophe in its filename, run "Repair translation links".[#N] tags. Lower Max Batch Input Length (try 2000–3000 chars) to reduce the chance of truncation.Ctrl/Cmd + Shift + I).python3 --version.python3 -c "import fitz; print(fitz.__version__)".python.exe (e.g. C:\Python311\python.exe).3 or 4 (higher = better quality, larger API payload).The plugin UI automatically switches between English and Russian based on Obsidian's language setting. To change Obsidian's language: Settings → General → Language.
All other languages currently display in English. To add a new language, edit i18n.ts and add a new locale object following the existing EN and RU pattern.
All PDF text and translation requests go directly from your machine to the API provider you configure. No data passes through any intermediate server operated by this plugin. When using Ollama, everything stays entirely local.
Built on Obsidian, PDF.js (bundled in Obsidian), and optionally PyMuPDF. Translation is powered by whichever AI provider you choose.