# Scanned PDF to text (OCR)

Read the text in a scanned PDF and get it as a text file, or as a PDF you can search and copy from.

Draws each page of the PDF as a picture, reads the printed text on it, and returns the text of all pages. It can also build a searchable copy of the PDF. Progress is reported page by page.

- Endpoint: `POST https://setget.net/v1/tools/ocr-pdf` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `ocr-pdf`
- Page: https://setget.net/tools/ocr-pdf

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `pdf` (required, file, a file reference such as `DROP_ID/f1`, accepts pdf): A PDF made of scanned or photographed pages.
- `language` (optional, string, one of `eng`, `deu`, `fra`, `spa`, `ita`, `por`, `nld`, `nor`, `swe`, `dan`, `pol`, `rus`, default `"eng"`): Language of the text: eng (English), deu (German), fra (French), spa (Spanish), ita (Italian), por (Portuguese), nld (Dutch), nor (Norwegian), swe (Swedish), dan (Danish), pol (Polish), rus (Russian).
- `output` (optional, string, one of `text`, `searchable_pdf`, `both`, default `"text"`): text gives a .txt file. searchable_pdf gives a PDF that looks like the scan and can be searched. both gives the two files.
- `pages` (optional, string, default `""`): Pages to read, such as 1-3, 7 or 5-. Leave empty for every page. At most 50 pages are read in one job.
- `dpi` (optional, integer, default `200`, range 100..300): Resolution each page is drawn at before reading, in dots per inch. Higher reads small print better and takes longer.

## Example 1: Read a two-page scan

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample-scan.pdf](https://setget.net/static/samples/sample-scan.pdf).

```json
{"input":{"pdf":"DROP_ID/f1"},"wait":30}
```

## Example 2: Make the first page searchable

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample-scan.pdf](https://setget.net/static/samples/sample-scan.pdf).

```json
{"input":{"pdf":"DROP_ID/f1","output":"searchable_pdf","pages":"1","dpi":150},"wait":30}
```

**What is a searchable PDF?** It looks exactly like the scan, with the text that was read placed invisibly behind each page, so you can search, select and copy it in any PDF viewer.

**How many pages can it read?** Up to 50 pages in one job. For a longer document, run it several times with "pages" set to 1-50, 51-100 and so on.

**My PDF already has text I can select. Should I use this?** No. Use pdf-text or pdf-to-markdown instead: they take the text straight from the file, which is faster and has no reading mistakes. This tool is for scans and photos saved as PDF.

**Which resolution should I choose?** 200 dots per inch suits normal print. Use 300 for small print such as footnotes. Use 150 to go faster when the print is large.

**Which languages can it read?** English, German, French, Spanish, Italian, Portuguese, Dutch, Norwegian, Swedish, Danish, Polish, Russian. Handwriting cannot be read.

**Does the searchable PDF keep my original pages?** Each page is saved again as a picture at the chosen resolution, so it looks the same on screen and in print, but text that was sharp at any zoom before becomes a picture.
