Extract text from PDFs, translate it, review the result, and export a new document. This Streamlit app supports single-file and batch workflows, with optional OCR for scanned pages.
- Features
- Quick start
- OCR for scanned PDFs
- How to use the app
- Languages
- Translation providers and privacy
- Exports and limitations
- File limits
- Development
- Extracts PDF text in reading order, with page, position, and font-size metadata.
- Uses an optional two-column reading-order heuristic for common layouts.
- Translates in manageable chunks, retries failed requests, and keeps source text when a block cannot be translated.
- Lets you review and edit the translation, with optional glossary entries to keep terminology consistent.
- Processes multiple PDFs and bundles completed documents into a ZIP archive.
- Exports reflowed TXT, DOCX, PDF, and JSON files.
- Caches extraction results during the session to avoid repeating work on routine reruns.
- Checks PDF signatures, page counts, file sizes, encryption, and extracted-text limits.
Use Python 3.10 or newer. Create a virtual environment, install the app dependencies, and launch Streamlit:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
streamlit run app.pyStreamlit opens the app in your browser, usually at http://localhost:8501.
OCR is optional. Install the Python packages and the system tools used to read scanned pages:
python -m pip install -r requirements-ocr.txtOn Debian or Ubuntu, install Tesseract and Poppler with:
sudo apt-get install tesseract-ocr poppler-utilsInstall Tesseract language data for the languages in your scans. Package names and installation steps vary by operating system.
- Upload one or more PDF files.
- Choose the source and target languages, translation provider, and optional OCR settings.
- Review the extracted text, then start translation after confirming the provider's data flow.
- Edit the translated text if needed. Add glossary terms in
source = translationformat, one entry per line. - Download an individual export or the ZIP archive for a multi-file run.
The app supports English, Indonesian, Vietnamese, French, Spanish, German, Japanese, Korean, and Simplified Chinese. You can also let the translation provider detect the source language automatically.
Google Translate is the default provider. The app asks for consent before sending extracted document text to this external service.
You can select LibreTranslate and provide a server URL with an optional API key. Document text is sent to that server. Use a self-hosted server if you want to keep processing under your control; the app cannot verify whether a configured server is local or private.
Exports are reconstructed, reflowed documents, not pixel-perfect copies of the original PDF. Complex tables, images, handwriting, links, exact typography, and mixed layouts may need manual review. DOCX heading levels are inferred from font-size metadata. OCR quality depends on scan resolution and installed language data. Inspect exported files before sharing them.
Password-protected, encrypted, and malformed PDFs are rejected. Translation provider limits and availability may vary.
| Limit | Maximum |
|---|---|
| PDF size | 25 MB per file |
| Pages | 100 per PDF |
| Extracted text | 750,000 characters per PDF |
| Files per run | 20 PDFs |
| Combined upload size | 100 MB per run |
Install the test dependencies and run the test suite:
python -m pip install -r requirements-dev.txt
python -m pytest -qTests use fake translation providers, so they do not consume provider quota. They cover the upload and consent flow, multi-file processing, extraction metadata, translation batching and glossary handling, partial failures, and DOCX/PDF export.