# PDF2TXT + Translator 1.0.0 A single-page, browser-only tool that pulls the text out of a PDF. The document is opened and parsed **on your own machine** — nothing is uploaded anywhere. There is no server, no account, no sign-up and no tracking code in the app. ## What the tool actually does - **Load one file at a time** — drag & drop it onto the drop zone or click to choose it. The picker accepts `.pdf`, `.txt`, `.md` and `.json`. - **Extract text from a PDF** — every page is read with the bundled PDF.js and joined into one plain-text document, with a progress bar (`Page i/total`). - **Or paste text directly** into the paste box and press *Load Pasted Text*. - **Edit the result** in a full-size editor (Select All / Deselect All / Fullscreen). - **Download TXT** (`extracted.txt`) or **Copy All** to the clipboard. - **Optional language-model steps** — Clean, Translate, Validate, or a combined workflow: `Clean → Translate → Validate`, `Translate → Validate`, `Clean → Validate`, `Translate Only`, `Clean Only`. - **Translate into 16 target languages** offered in the page: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, Russian, Arabic, Hindi, Turkish, Dutch, Polish, Swedish. The text is split at word boundaries and sent one chunk at a time (1,500 characters by default, 2,500 when a `:cloud` model is chosen), with pause and stop buttons and a token counter. - **Settings tab** — API source (Proxied `/ollama`, Local `localhost:11434`, or a Custom URL), optional API key, *Refresh Models* (reads `/api/tags`), and chunk size. It does **not** do OCR, batch/multi-file processing, or translation presets. A scanned PDF with no text layer will come out empty. ## What you receive ``` pdf2txt/ ├── src/index.html the whole application (HTML + CSS + JS, no build step) ├── vendor/pdf.min.js PDF.js core library ├── vendor/pdf.worker.min.js PDF.js worker ├── docs/USAGE.md step-by-step guide for non-technical users ├── README.md this file ├── CHANGELOG.md ├── LICENSE └── VERSION ``` ## How to run it The page loads PDF.js as a Web Worker. Some browsers refuse to start a worker from a `file://` URL (Chrome blocks it; a headless Chromium on this host happened to allow it), so double-clicking `src/index.html` may load but extract nothing. If that happens, serve the folder over plain HTTP — no dependencies, Python 3 is enough: ```bash cd products/pdf2txt python3 -m http.server 8000 ``` Then open . Any static web server works the same way; upload the whole `pdf2txt` folder to any host and open `src/index.html`. ## Optional translation Translation is **off by default in the sense that you must point it at a model**. The page talks to an Ollama-compatible API using `POST /api/generate`. The model used for offline translation is named in the page's Local model list as: ``` translategemma:latest ``` To use it entirely offline: 1. Install [Ollama](https://ollama.com) and run `ollama pull translategemma:latest`. 2. In the app open the **Config** tab, set **API Source** to `Local (localhost:11434)`. 3. In the **Translate** section pick `translategemma:latest` as the Translation Model. 4. Choose a target language and press **Translate**. Two honest caveats about the shipped defaults: - The default **API Source** is `Proxied (/ollama)`, which expects a server-side proxy at `/ollama`. On a plain static host use `Local` or a `Custom URL`. - The default **Translation Model** is `glm-5.3-flash:cloud` — a cloud model. For a fully local, offline run you must switch it to `translategemma:latest` (or another model you have pulled, such as `llama3.2:latest` or `qwen2.5:7b-instruct`). Without a reachable model endpoint, PDF extraction, editing, copy and TXT download all still work; only the Clean/Translate/Validate buttons fail. ## Licence MIT © 2026 Akan Goksu Valdes — see [LICENSE](LICENSE). The files in `vendor/` are PDF.js and remain under the Apache License 2.0.