You can translate PDFs locally and keep the formatting on your own workstation: the translated document keeps its tables, images and page layout, and the files never leave the company. For PDFs the job is done by pdf2zh-next, the 2.x branch of PDFMathTranslate built on the BabelDOC library: the text goes to a language model on your GPU and the translation is written back into the page. Word, PowerPoint and ODF files are covered by LibreTranslate and the ONLYOFFICE editor. How much of the layout survives depends on the file, so the work starts with a test.
This guide is for export, technical documentation and back-office teams who currently send contracts and manuals to DeepL, and for the IT specialist who will set everything up. Choosing translation models and sizing a server by words per day is covered in the article on machine translation on your own server. This one is about the files.
In brief
- pdf2zh-next rebuilds every PDF page around the translated text and returns both a translated and a bilingual PDF; the model is connected through an OpenAI-compatible API such as vLLM.
- Word, PowerPoint and ODF go through LibreTranslate or the ONLYOFFICE editor; none of these tools documents how much formatting is preserved.
- BabelDOC says openly that its focus is English to Chinese, so Ukrainian, Russian and scanned documents need testing.
- Qwen3.8-27B in NVFP4 fits on a single 32 GB RTX PRO 4500; on the Server Edition StorageReview measured 320 output tokens/s in total at 32 requests, which by our estimate means about two minutes of model time per 20,000-word manual.
- The licence of PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate is AGPL-3.0, while NLLB-200, which covers Ukrainian, carries the non-commercial CC-BY-NC-4.0.
Tools for translating PDF, Word and ODF locally
A layout tool rebuilds the PDF page, a file endpoint swaps the text inside Word or ODF files, and an editor translates whatever text a user has open.
| Tool | Version (October 2026) | Files | Worth knowing |
|---|---|---|---|
| pdf2zh-next | 2.9.0 of 15.05.2026 | PDF to PDF | runs on BabelDOC; the authors offer no usage support |
| BabelDOC | 0.6.4 of 16.07.2026 | early development; tested for English into Chinese | |
| PDFMathTranslate | updates up to 03.10.2026 | 1.x branch; 2.0 continues as pdf2zh-next | |
| LibreTranslate | 1.9.6 of 26.05.2026 | docx, pptx, odt, pdf and others | Argos Translate neural models; works offline |
| ONLYOFFICE Docs | 10.0 of 10.10.2026 | inside the editor | AI tools installed separately in the open-source editions |
Source: GitHub repositories and READMEs, PyPI release pages, the LibreTranslate API reference, the ONLYOFFICE release blog and help centre; read 30.10.2026.
PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate are all AGPL-3.0. If you modify the code or open the service to people outside the company, show the licence terms to a lawyer.
How to translate a PDF and keep the layout: pdf2zh-next and BabelDOC
PDFMathTranslate started as a translator for scientific papers. Version 2.0 moved to the PDFMathTranslate-next repository (pdf2zh-next on PyPI), the official reference implementation for calling BabelDOC. Using BabelDOC directly is not supported by its authors. You run pdf2zh-next from its web interface, from the command line, or as a Docker image whose web UI listens on port 7860.
Local models connect through the OpenAICompatible engine, which pdf2zh-next supports officially, and BabelDOC accepts nothing but LLMs behind an OpenAI-compatible API. vLLM provides such an endpoint, on the workstation itself or elsewhere on the local network. Ollama appears in the service list of PDFMathTranslate 1.x.
Options that matter for business documents:
--lang-inand--lang-outchoose the languages;--pagesrestricts the run to ranges like 1,3,10-20.--no-dualor--no-monodrops the bilingual or the single-language PDF, and--use-alternating-pages-dualalternates pages rather than putting them side by side.--glossariesexpects CSV with three columns (source, target, tgt_lng), and BabelDOC injects the relevant terms into its prompts;--save-auto-extracted-glossarykeeps the automatically extracted terms for review.--qpsand--pool-max-workersset how many requests hit the model in parallel, and with that the speed.--watermark-output-modewith the value no_watermark removes the watermark BabelDOC adds by default.
The authors are direct about limitations. According to the BabelDOC README, scenarios other than English-to-Chinese translation have not been tested yet, and skipping of large pages appears among its known issues. The pdf2zh-next authors warn that they give no help with using the tool.
How to translate a Word document locally: LibreTranslate and ONLYOFFICE
Both pdf2zh-next and BabelDOC take PDF input only, which turns a Word file into a PDF on output. If you need an editable document at the end, two documented routes exist.
LibreTranslate is self-hosted and runs offline. Its /translate_file endpoint takes the file together with the source and target language codes and answers with a download link. File formats are handled by the Argos Translate files library: .txt, .odt, .odp, .docx, .pptx, .epub, .html, .srt and .pdf. The translating is done by Argos Translate neural models, with no LLM involved. Neither project says whether formatting is kept, and you should check before installing whether Argos Translate offers the Ukrainian pair you need. For GPUs the repository ships a docker-compose.cuda.yml.
ONLYOFFICE Docs 10.0 brought AI tools into the editors, including translation of text right on the page. In the open-source editions they are installed separately, and a model, local ones included via Ollama or LM Studio, is connected at a base URL. This suits working through one contract at a time; there is no batch mode. Setup is described in the article on ONLYOFFICE AI with a local LLM.
Translating confidential documents without the cloud
Once pdf2zh-next talks to vLLM running on hardware you own, the PDF, its text, the glossary and the output all remain on that machine. Two settings make the difference. Choose OpenAICompatible as the service and enter your base URL, since the tools also know cloud engines, and PDFMathTranslate 1.x uses Google by default. On a workstation with no internet access BabelDOC needs an offline package of models and fonts, generated first on a machine that is online. Watch the outbound connections during the first test.
DeepL's PDF translator page (read 30.10.2026) promises Pro users that documents are deleted after translation. The file still travels to the provider, whereas in the local setup contracts and tenders stay inside your network.
If the documents contain personal data, Law No. 2297-VI applies: processing needs a ground under Article 11, and transfers abroad are possible on the terms of Article 29. The Law "On Cloud Services" No. 2075-IX forbids processing state secrets, official information and state register data in clouds and data centres outside Ukraine; part of these restrictions has been relaxed under martial law. An on-site server lowers the transfer risk but does not replace a legal ground, so a lawyer should assess the specific case.
Translating scanned PDFs and Cyrillic OCR
A scan has no text until recognition (OCR) has run. In its OCR workaround, BabelDOC prints the translation as black text over a white background, and its README limits the mode to pages that are black on white to begin with; --auto-enable-ocr-workaround turns it on for files that are mostly scanned. Pages with colour, seals or handwriting need OCR as a separate step.
Cyrillic is recognised by Tesseract (language packs ukr and rus, data under Apache 2.0), PaddleOCR PP-OCRv5 with its eslav model for Ukrainian, Russian, Belarusian and English (81.6% on the developers' own test set) and EasyOCR. Docling has no Cyrillic recognition of its own: Ukrainian comes from the RapidOCR engine (cyrillic and eslav models) or from EasyOCR. More in the article on Docling and MinerU.
Which model to use for translation into Ukrainian
A layout tool sends paragraphs along with instructions, so it needs a general instruction-following model. Google's TranslateGemma requires a strict chat template: user and assistant roles only, fields for the language codes, no system prompt. We found no support for that template in the pdf2zh-next or BabelDOC docs, so TranslateGemma fits a pipeline built around it.
| Model | Licence | Weights | Smallest card |
|---|---|---|---|
| gpt-oss-20b | Apache 2.0 | MXFP4, 13.8 GB | 24 GB RTX PRO 4000 |
| Qwen3.8-27B, NVFP4 | Apache 2.0 | 21.9 GB | 32 GB RTX PRO 4500 |
| Qwen3.8-27B, FP8 | Apache 2.0 | 30.9 GB | 48 GB RTX PRO 5000 |
| EuroLLM-22B-Instruct | Apache 2.0 | BF16, around 45 GB | 72 GB RTX PRO 5000 |
| TranslateGemma 12B, 27B | Gemma Terms of Use | BF16, around 26 and 58 GB | 48 or 72 GB RTX PRO 5000 |
Source: model cards on Hugging Face, read 30.10.2026; BF16 at two bytes per parameter and the smallest card from our users-per-card rule (our estimate).
EuroLLM-22B covers 35 languages, the 24 official EU languages among them, with a 32,768-token context; TranslateGemma claims 55 languages and an input context of 2K tokens. NVIDIA released the NVFP4 build of Qwen3.8-27B in September 2026 under Apache 2.0 for commercial and non-commercial use. We found no published Ukrainian translation quality for these models, and no metrics for the Ukrainian and Russian pair.
Ukrainian figures do exist for other models:
| Model | Licence | FLORES en→uk, BLEU | FLORES uk→en, BLEU |
|---|---|---|---|
| Gemma 4 26B A4B (reasoning) | Apache 2.0 | 32.02 | 41.33 |
| MamayLM-Gemma-3-27B-IT-v2.0 | Gemma Terms of Use | 30.97 | 41.65 |
| MamayLM-Gemma-3-12B-IT-v2.0 | Gemma Terms of Use | 30.24 | 40.23 |
| Llama-3.1-8B-Instruct | not checked | 18.64 | n/a |
Source: Ukrainian LLM Leaderboard (lang-uk), files of 04.05.2026, 13.04.2026 and 21.10.2025; read 13.11.2026. Gemma 4 was measured in reasoning mode, MamayLM without it.
Dragoman from lang-uk (an adapter for Mistral-7B, Apache 2.0) scores 32.34 BLEU on FLORES-101 dev in its authors' measurement, against 30.46 for NLLB 3B. It translates only from English into Ukrainian, sentence by sentence, and its figures cannot be compared directly with the leaderboard. OPUS-MT and MADLAD-400 are Apache 2.0. NLLB-200 is CC-BY-NC-4.0, and its card calls it a research model not meant for production use or document translation.
Which GPU you need for document translation
GPU memory has to fit the model weights plus room for paragraphs in progress. Our users-per-card rule takes 90% of the driver-reported memory and subtracts 3 GiB per card, which leaves for weights and work 18.5 GiB on the RTX PRO 4000 (24 GB), 25.7 GiB on the RTX PRO 4500 (32 GB), 40.0 GiB on the RTX PRO 5000 (48 GB), 61.5 GiB on its 72 GB version and 83.0 GiB on the RTX PRO 6000 (96 GB).
| Tier | Hardware | What runs | Who it is for |
|---|---|---|---|
| Starter | workstation with one 24 GB RTX PRO 4000 | LibreTranslate for Word and ODF, gpt-oss-20b for PDFs | a single translator or assistant |
| Department | workstation with an RTX PRO 4500 (32 GB) or an RTX PRO 5000 (48/72 GB) | 32 GB: Qwen3.8-27B NVFP4; 48 GB: the same model in FP8; 72 GB: EuroLLM-22B | a department running overnight batches |
| Several teams | workstation with one or two RTX PRO 6000 Workstation Edition cards | EuroLLM-22B next to Qwen3.8-27B FP8 on a single card | several departments |
| Company-wide service | rack server, RTX PRO 6000 Server Edition or L40S | an API serving people and other systems | the whole company, running continuously |
Source: our estimate using the users-per-card rule and the weights from the model table (42.2 + 28.7 = 70.9 of 83.0 GiB on a single 96 GB card).
On the RTX PRO 4500 the NVFP4 build of Qwen3.8-27B occupies 20.4 GiB, so roughly 5.3 GiB stay free; translation requests are short, so that covers many paragraphs in parallel. StorageReview tested this model on 14 October 2026 with vLLM 0.27.1, each request carrying 512 tokens in and 512 out. At 32 concurrent requests the RTX PRO 4500 Server Edition reached 320 output tokens/s in total, and an RTX PRO 6000 Workstation Edition with a 450 W power limit (standing in for the server card in that review) reached 621 tokens/s. Serving a single request, each card delivered 17 to 22 tokens/s. No figure has been published for the desktop RTX PRO 4500 (896 GB/s and 200 W against 800 GB/s and 165 W for the Server Edition); the card itself is covered in our RTX PRO 4500 Blackwell review.
A worked example, our estimate: take a manual of 40 pages and 20,000 words. Planning with 2 tokens per word, the model must generate roughly 40,000 tokens. At 320 tokens/s it needs around two minutes; one request at a time stretches this to 30 to 40 minutes. For Ukrainian, tokens per word depend on the tokeniser (Lapa's adapted tokeniser needs about 1.5 times fewer tokens for Ukrainian text), so measure the figure on your own texts. Qwen3.8-27B reasons before answering by default, so both numbers assume that mode is switched off via enable_thinking, and layout analysis and PDF assembly come on top. ETE sizes the configuration for your language pairs and volumes from a sample of your pages, and Vixen.UNO engineers can install pdf2zh-next, LibreTranslate and the model.
How to test translation on your own documents
Take 10 to 20 real documents of each type with tables, headers and footers, part numbers and legal wording.
- Compare the page count and layout against the original; mark text that overflows its box and broken tables.
- Confirm every page was translated, since skipped large pages are a known BabelDOC issue.
- Make sure numbers, part numbers and names are unchanged.
- Put approved terms into a CSV glossary and check how they are used.
- Ask a native speaker to mark errors in the bilingual file.
- Measure seconds per page at your planned concurrency and choose the card on that basis.
When a translation comes back as a new contract draft, a local comparison of versions finds what changed.
FAQ
How do I translate a PDF locally and keep the formatting?
Run pdf2zh-next, which is built on BabelDOC, and connect it over an OpenAI-compatible endpoint to a model served on your GPU, for example by vLLM. The tool rebuilds each page and writes a translated and a bilingual PDF. Test Ukrainian and Russian on your own documents first, because BabelDOC was tested on English to Chinese.
Is there a local alternative to DeepL for documents?
Yes, as a set of tools: pdf2zh-next for PDFs, LibreTranslate for Word, PowerPoint and ODF, and the ONLYOFFICE editor with a local model. With BabelDOC's offline package the files stay inside your network, and translation quality depends on the model you pick.
Can I translate a Word document with a local LLM?
Yes, in the ONLYOFFICE 10.0 editor via Ollama or LM Studio. LibreTranslate translates a whole Word file, but with Argos Translate models and no LLM. Check on your own templates how much formatting survives.
Which model translates English into Ukrainian most accurately?
On the Ukrainian LLM Leaderboard, FLORES en→uk, Gemma 4 26B A4B in reasoning mode scores 32.02 BLEU and MamayLM 27B without it 30.97. This is a sentence-level metric, so repeat the comparison on your own contracts and manuals. NLLB-200 is ruled out for commercial document translation by its CC-BY-NC-4.0 licence.
What GPU do I need for local document translation?
One person is served by a 24 GB RTX PRO 4000 with LibreTranslate and gpt-oss-20b. A department can run Qwen3.8-27B (NVFP4) on the 32 GB RTX PRO 4500, which reached 320 output tokens/s in total as a Server Edition at 32 requests. Larger models and several teams call for a 72 GB RTX PRO 5000 or an RTX PRO 6000.
Can a company use PDFMathTranslate for free?
PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate are AGPL-3.0, which permits commercial use. Conditions apply once a changed version is offered to users across a network. A lawyer should decide whether they affect your setup.
What ETE supplies for this
- NVIDIA RTX PRO 4500 Blackwell 32 GB: holds Qwen3.8-27B in NVFP4 (20.4 GiB) for a department's translations, 896 GB/s at 200 W.
- NVIDIA RTX PRO 5000 Blackwell 48 GB: Qwen3.8-27B in FP8 (28.7 of 40.0 GiB) or TranslateGemma 12B on one card.
- ETE AI Workstation: RTX PRO 6000 with 96 GB, where EuroLLM-22B and Qwen3.8-27B FP8 run side by side (70.9 of 83.0 GiB).
- ETE AI Server RTX PRO: four RTX PRO 6000 Server Edition cards, 384 GB of GPU memory for translation as a company-wide service.
Which workstation suits your documents and language pairs?
Send us a few sample pages, your language pairs, a rough monthly volume, and tell us whether the workstation may have internet access. ETE will work out the configuration and, if needed, Vixen.UNO engineers will install pdf2zh-next, LibreTranslate and a local model.