BLOG · GUIDE ·

Translate PDF and Word files locally with the layout kept: tools, models and GPUs

Eurokommerz, Vienna, since 2006: Private AI/ML · IT Managed Services · Enterprise Training · AI Hardware & Software

IN BRIEF
  • To translate a PDF locally and keep its layout, a tool such as pdf2zh-next, built on BabelDOC, rebuilds each page with the translated text and sends the text to a language model on your own GPU through an OpenAI-compatible endpoint such as vLLM; it returns a translated and a bilingual PDF
  • Word, PowerPoint and ODF files go through LibreTranslate's file endpoint or through translation inside the ONLYOFFICE editor with a local model; none of these tools documents how much formatting survives, so test with your own templates
  • BabelDOC states that it "mainly focuses on English-to-Chinese translation", and its OCR workaround suits only black text on white, so German and other European languages and scanned files need a test before rollout
  • By our users-per-card rule one 32 GB RTX PRO 4500 holds Qwen3.8-27B in NVIDIA's NVFP4 build; StorageReview measured 320 output tokens per second for Qwen3.8-27B in NVFP4 on the Server Edition of the card at 32 parallel requests, about 2 minutes of model time for a 20,000-word manual by our estimate
  • PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate are all under AGPL-3.0 (as of October 2026), and TranslateGemma needs its own prompt template, which the layout tools do not document
  • You can order the workstation alone, the setup of pdf2zh-next, LibreTranslate and a local model alone, or both together: the workstation delivered with everything installed and configured

Supplied by Eurokommerz: NVIDIA RTX PRO 4500 Blackwell  Check price and availability →

Translating documents locally with the layout kept

You can translate PDF and Word files offline on your own workstation and get the document back in another language with its tables, images and page layout, and confidential files stay in the company; how well the layout survives depends on the file, so a test with your own documents comes first. For PDFs, pdf2zh-next (the 2.x line of PDFMathTranslate, built on BabelDOC) sends the text to a language model on your own GPU and writes the translation back into the page; for Word, PowerPoint and ODF files, LibreTranslate translates whole files and the ONLYOFFICE editor translates on the page with a local model. By our sizing rule, one NVIDIA RTX PRO 4500 Blackwell (32 GB) in a workstation runs Qwen3.8-27B, a 27-billion-parameter model, for a department.

This guide is for export sales, technical documentation and back-office teams that send contracts, manuals and offers to DeepL or another cloud service today and want the files to stay in the company, and for the IT person who sets it up. A language model here means the AI program that does the translating; it runs on the graphics card (GPU) of the workstation. The choice of translation models, their licences and server sizing by words per day are in our guide to on-premise machine translation; this article is about the files.

Three routes for three kinds of file

Each route keeps the layout in a different way. A layout tool reads the PDF's page structure and rebuilds it; a file endpoint replaces the text inside a Word or ODF file; an editor translates the text a person has open.

TOOLVERSION (OCT 2026)FILESWHAT TO KNOW
pdf2zh-next2.9.0, 15 May 2026PDF in, PDF outbuilt on BabelDOC; maintainers give no usage help
BabelDOC0.6.4, 16 July 2026PDF"early stage of development"; tested for English to Chinese
PDFMathTranslateupdates to 3 Oct 2026PDFthe 1.x line; 2.0 moved to pdf2zh-next
LibreTranslate1.9.6, 26 May 2026docx, pptx, odt, pdf and moreNMT models from Argos Translate; offline capable
ONLYOFFICE Docs10.0, 10 Oct 2026in the editorAI tools installed separately in open-source versions

GitHub repositories and READMEs, PyPI release pages, LibreTranslate API reference and ONLYOFFICE's release blog and help centre, read on 30 October 2026.

PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate are all published under the AGPL-3.0. That licence sets conditions when a modified version is offered to users over a network, which is a question for your legal department if you change the code or offer the service outside the company.

The PDF route: pdf2zh-next and BabelDOC

PDFMathTranslate began as a translator for scientific papers, described on GitHub as "PDF scientific paper translation with preserved formats", with 38.0k stars on 30 October 2026. Its README states that version 2.0 moved to a new repository, PDFMathTranslate-next, published on PyPI as pdf2zh-next. That project calls itself "the official reference implementation for calling BabelDOC to perform PDF translation". BabelDOC is the library that analyses the page layout and rebuilds it; its README says that "any direct use of BabelDOC is not supported" and that its command line is "mainly for debugging purposes". In practice you run pdf2zh-next, through its web interface, its command line or a Docker image with the web interface on port 7860.

For a local model, pdf2zh-next's list of officially supported engines includes OpenAICompatible, and BabelDOC states that "only OpenAI-compatible LLM is supported". vLLM, the serving engine our Private AI/ML service deploys, provides that kind of endpoint, so the tool talks to a model on the same workstation or on a server in your network. PDFMathTranslate 1.x also names Ollama among its services.

The options that matter for business documents are documented on pdf2zh-next's advanced page:

  • --lang-in and --lang-out set the languages, and --pages limits the job to page ranges such as 1,3,10-20.
  • The tool writes a translated PDF and a bilingual one; --no-dual or --no-mono drops either, and --use-alternating-pages-dual interleaves the pages instead of placing them side by side.
  • --glossaries takes CSV files with the columns source, target and tgt_lng, and BabelDOC adds the matching terms to the prompts. The tool also extracts terms automatically; --save-auto-extracted-glossary saves that list for review, and --no-auto-extract-glossary switches it off.
  • --qps and --pool-max-workers set how many requests run against the model at once, which decides the speed on a GPU.
  • BabelDOC's default watermark mode is "watermarked", and --watermark-output-mode with no_watermark turns it off for documents that leave the company.

The limits are stated just as plainly. BabelDOC's README says: "Currently, this project mainly focuses on English-to-Chinese translation, and other scenarios have not been tested yet." It also lists "Large pages will be skipped" among known issues, and calls itself "still at an early stage of development". The pdf2zh-next maintainers state that "we do not provide any form of usage assistance or problem-solving". The tools are usable; the test on your own documents described below is part of the setup, and somebody in the company has to own the installation.

You can order the workstation alone, the setup of pdf2zh-next, LibreTranslate and a local model alone, or both together: the workstation delivered with everything installed and configured; write to us and we suggest the best solution for your tasks and budget.

Word, PowerPoint and the ONLYOFFICE editor

pdf2zh-next and BabelDOC accept PDFs only, so a Word file comes back from them as a PDF. When the result must stay an editable Word, PowerPoint or ODF file, two documented routes remain.

LibreTranslate, "Self-hosted, offline capable and easy to setup" in its own words, has a /translate_file endpoint that takes a file with a source and target language and returns a link to the translated file. Its file handling comes from the Argos Translate files library, which lists ".txt, .odt, .odp, .docx, .pptx, .epub, .html, .srt, .pdf". The translation itself comes from the neural translation models of the Argos Translate library; no LLM is involved. Neither project states whether the formatting survives. The repository includes a docker-compose.cuda.yml for running on a GPU.

ONLYOFFICE Docs 10.0, released on 10 October 2026, adds AI tools to the editors, and its release blog lists "Translate text directly on the page" for the document editor. The same blog states that "we've removed built-in AI from the open-source versions" and that "AI tools are installed separately"; server builds can "connect any AI model", including local ones. The help centre names Ollama and LM Studio as local providers, connected by a base URL, and connects no model by default. This route suits a person who works through one contract or offer at a time; it is not a batch tool. Setup and the graphics card for the editor's AI are in our guide to ONLYOFFICE AI with a local LLM.

Translating confidential documents without the cloud

With pdf2zh-next pointed at a vLLM server on your own hardware, the PDF, the extracted text, the glossary and the translation stay on that hardware. Two settings decide it. The service has to be set to OpenAICompatible with your own base URL, because the tools also list hosted services: PDFMathTranslate 1.x uses Google by default according to its README, and pdf2zh-next's list includes several hosted engines, one of them free. And on a workstation without internet access, BabelDOC needs its offline assets package with the models and fonts it uses, which its README says to generate first on a machine with internet access. Check the outbound connections on the first test run.

For comparison, DeepL's page on its PDF translator, read on 30 October 2026, states that for Pro users "uploaded PDF documents are deleted after translation and are never stored". The file still travels to the provider for the translation. With the local setup it does not leave your network, and that matters for confidential contracts, tenders and unpublished product documentation. Our guide to local AI and the GDPR covers what own hosting solves and what stays your duty.

Scanned PDFs and OCR

A scan is a picture of a page, with no text the tool can read until text recognition (OCR) has run. BabelDOC has an OCR workaround that writes the translation in black on a white background, and its README calls it "Only suitable for documents with black text on white background". --auto-enable-ocr-workaround switches it on when a document is detected as heavily scanned. Scans with coloured backgrounds, stamps or handwriting need a separate OCR step and a test of the result. Our guides to PDF parsing with Docling and MinerU and to vision-language models for document AI cover OCR and document models on GPUs.

Which model does the translating

A layout tool sends paragraphs with instructions, so it needs a general instruction model. TranslateGemma, Google's translation model, is a special case: its card defines a strict chat template with only user and assistant roles, one content entry per message and fields for the source and target language code, and no system prompt. We found nothing in the pdf2zh-next or BabelDOC documentation that sends that template, so TranslateGemma suits a pipeline built for it.

MODELWEIGHTSSMALLEST CARDLICENCE
gpt-oss-20b13.8 GB (MXFP4)RTX PRO 4000, 24 GBApache 2.0
Qwen3.8-27B, NVFP421.9 GBRTX PRO 4500, 32 GBApache 2.0
Qwen3.8-27B, FP830.9 GBRTX PRO 5000, 48 GBApache 2.0
EuroLLM-22B-Instructabout 45 GB (BF16)RTX PRO 5000, 72 GBApache 2.0
TranslateGemma 12B, 27Babout 26 and 58 GB (BF16)RTX PRO 5000, 48 or 72 GBGemma Terms of Use

Hugging Face model cards (EuroLLM-22B-Instruct-2512, TranslateGemma 12B, NVIDIA Qwen3.8-27B-NVFP4) read on 30 October 2026; checkpoint sizes as in our guides to Qwen3.8-27B on the RTX PRO 4500, to 30B models on 24 GB cards and to machine translation; BF16 at two bytes per parameter by our estimate; smallest card by our users-per-card rule.

EuroLLM-22B covers 35 languages, all 24 official EU languages among them, with a context of 32,768 tokens, and its card shows 22.639 billion parameters. TranslateGemma's cards give a "Total input context of 2K tokens" and 55 languages, and access requires accepting Google's usage licence. NVIDIA's NVFP4 build of Qwen3.8-27B, published in September 2026, is Apache 2.0 and "ready for commercial or non-commercial use". We found no published translation quality for German contracts or manuals on any of these models, so the comparison on your own texts decides.

Hardware: from one translator's workstation to a translation service

The GPU memory holds the model weights plus a working area for the paragraphs in progress. Our users-per-card rule takes 90 per cent of the memory the driver reports, minus 3 GiB per card, minus the weights; that leaves 18.5 GiB on a 24 GB RTX PRO 4000, 25.7 GiB on a 32 GB RTX PRO 4500, 40.0 GiB on a 48 GB RTX PRO 5000, 61.5 GiB on the 72 GB card and 83.0 GiB on a 96 GB RTX PRO 6000.

TIERHARDWAREWHAT IT RUNSFOR WHOM
Entryworkstation, 1 × RTX PRO 4000 (24 GB)LibreTranslate for Word and ODF; gpt-oss-20b for PDFsone translator or assistant
Departmentworkstation, 1 × RTX PRO 4500 (32 GB) or RTX PRO 5000 (48 or 72 GB)Qwen3.8-27B in NVFP4 on 32 GB, in FP8 on 48 GB; EuroLLM-22B on 72 GBa department with overnight batches
Several teamsworkstation, 1 or 2 × RTX PRO 6000 Workstation EditionEuroLLM-22B and Qwen3.8-27B in FP8 side by side on one cardseveral departments
Company serviceserver with RTX PRO 6000 Server Edition or L40Sthe models as an API for users and systemscompany-wide, in continuous operation

Our estimates by the users-per-card rule with the weights in the model table (42.2 + 28.7 = 70.9 GiB of 83.0 GiB on one 96 GB card); server sizing by words per day as in our machine translation guide.

On the RTX PRO 4500, NVIDIA's NVFP4 build of Qwen3.8-27B takes 20.4 GiB and leaves about 5.3 GiB for the work in progress, as our guide to Qwen3.8-27B on the RTX PRO 4500 Server Edition shows. Translation requests are short, a paragraph with its instructions, so that is enough for many requests at once. StorageReview's review of 14 October 2026 measured this model in NVFP4 with vLLM 0.27.1 at 512 input and 512 output tokens per request. At 32 parallel requests the RTX PRO 4500 Server Edition produced 320 output tokens per second, and an RTX PRO 6000 Workstation Edition capped at 450 W, which the review used as a stand-in for the server card, produced 621. With one request at a time, "every card landed between 17 and 22 tokens/s". The workstation RTX PRO 4500 has 896 GB/s and 200 W against the Server Edition's 800 GB/s and 165 W; no figure for it was published.

A worked example, by our estimate: a 40-page manual of 20,000 words needs about 40,000 output tokens at our planning figure of 2 tokens per word (a preprint of May 2026 counts 1.76 for German on average, as our article on tokens per word in European languages reports). At 320 tokens per second that is about 2 minutes of model time; one request at a time, at 17 to 22 tokens per second, takes 30 to 40 minutes. Both figures assume the thinking mode is off: Qwen3.8-27B thinks before it answers by default, and its card documents switching this off per request with enable_thinking set to false, so check in the test that the tool's requests do this, or the output and the time grow. The layout analysis and the rebuilding of the PDF come on top, and nobody has published their time on these cards, so measure a day's sample. More parallel requests, set with --qps and --pool-max-workers, move the job from the second figure towards the first.

We supply the RTX PRO 4500 and the other RTX PRO cards in workstations built to order; send us a few sample pages and your language pairs and we suggest the best solution for your tasks and budget.

Testing on your own documents before rollout

Because BabelDOC was tested for English to Chinese, a short test on your own files is the only reliable answer for German and other European languages. Take ten to twenty real documents per type, with tables, headers and footers, numbered lists, part numbers and legal wording, and run them through the chosen tool and model.

  1. Compare the page count and layout of each translated file with the original, and note text that no longer fits its box or tables that break.
  2. Check every page was translated, since BabelDOC lists skipped large pages as a known issue.
  3. Check that numbers, units, part numbers and names are unchanged.
  4. Put your approved terms into a glossary CSV and check they are used throughout; review the automatically extracted terms.
  5. Have a native speaker mark errors in the bilingual output, which shows source and translation together.
  6. Time the run per page with the parallel requests you plan to use, and size the card from that.

Our Private AI/ML service deploys open models on-premise with vLLM or Ollama, so data does not leave your network.

FAQ

How can I translate a PDF locally and keep the formatting?
Run a layout tool such as pdf2zh-next, the 2.x line of PDFMathTranslate built on BabelDOC, and connect it to a language model on your own GPU through an OpenAI-compatible endpoint such as vLLM. It rebuilds each page with the translated text and writes a translated and a bilingual PDF. BabelDOC was tested mainly for English to Chinese, so test German and other European languages on your own documents first.
Is there a self-hosted alternative to DeepL for documents?
Yes, as a combination of tools: pdf2zh-next for PDFs with the layout kept, LibreTranslate for Word, PowerPoint and ODF files, and translation inside the ONLYOFFICE editor with a local model. All run on your own hardware, and with a local model and the offline assets the files do not leave your network. Translation quality depends on the model you choose, so compare it on your own texts.
Can I translate a Word document with a local LLM?
Yes, in the ONLYOFFICE editor, whose version 10.0 connects local models through Ollama or LM Studio and translates text on the page, or as a whole file through LibreTranslate's file endpoint, which uses NMT models rather than an LLM. pdf2zh-next and BabelDOC take PDFs only. None of these tools documents how much formatting survives, so test with your own templates.
Which GPU do I need for local document translation?
For one person, a 24 GB RTX PRO 4000 runs LibreTranslate and a model such as gpt-oss-20b. For a department, a 32 GB RTX PRO 4500 holds Qwen3.8-27B in NVIDIA's NVFP4 build by our rule, and StorageReview measured 320 output tokens per second for the model in NVFP4 on the Server Edition of the card at 32 parallel requests. Larger models and several teams need an RTX PRO 5000 with 72 GB or an RTX PRO 6000 Workstation Edition.
Does PDFMathTranslate work with Ollama or vLLM?
PDFMathTranslate 1.x lists Ollama among its translation services. The 2.x line, pdf2zh-next, lists OpenAI-compatible endpoints among its officially supported engines, and BabelDOC supports only OpenAI-compatible LLMs; vLLM provides such an endpoint. Set the service and base URL explicitly, because the tools also list hosted services.
Can scanned PDFs be translated locally?
Partly. BabelDOC's OCR workaround writes the translation in black on a white background and is, in its README's words, only suitable for documents with black text on white background. Scans with colour, stamps or handwriting need a separate OCR step and a test of the result before you rely on it.
Is PDFMathTranslate free for commercial use?
PDFMathTranslate, pdf2zh-next, BabelDOC and LibreTranslate are published under the AGPL-3.0, which allows commercial use and sets conditions when a modified version is offered to users over a network. Whether those conditions apply to your setup is a question for your legal department.

We supply RTX PRO workstations for document translation alone, set up pdf2zh-next, LibreTranslate and a local model alone, or deliver both together. Describe your task in a few sentences and our team will help. We reply within one business day. The first call is free.

Talk to an expert
Talk to an expert

We reply within one business day

By sending this form you agree that we process your details to answer your enquiry; see our privacy policy.

request@eurokommerz.at
Jordangasse 7, 1010 Vienna