# OCR Image: web app, CLI and MCP

## What it does
Run OCR on a scanned document or image to extract text as a new PDF. Runs OCR (Tesseract) on image files and returns extracted text.

## Inputs and limits
**Command line options**

* `--language` (string, default "eng"): Tesseract language code (default 'eng').
* `--output-to-single` (bool, default false): Combine all results into one output.
* `--output-mode` (string, default "hocr"): Output format: hocr|text|... (default 'hocr').

**MCP parameters of `run_ocr`**

* `fileUrl` (string, required): Public URL of the scanned file or image
* `lang` (string): OCR language code (e.g. en, de, fr)

## Web app
Open the web app: [Image to text (OCR)](https://products.documentize.app/image_to_txt).

## Command line (CLI)
The `Documentize.OcrImage` plugin: Runs OCR (Tesseract) on image files and returns extracted text.

Replace `input-file` with your file and add the options listed above after `--task-id job1`.

```bash
# Linux / macOS (needs the .NET 10 runtime and documentize.lic next to the DLL)
export PLUGIN_INPUT_DIR=./work/input
export PLUGIN_OUTPUT_DIR=./work/output
mkdir -p "$PLUGIN_INPUT_DIR/job1"
cp input-file "$PLUGIN_INPUT_DIR/job1/"
dotnet Documentize.OcrImage.dll --task-id job1
ls "$PLUGIN_OUTPUT_DIR/job1"
```

```powershell
# Windows PowerShell
$env:PLUGIN_INPUT_DIR  = "$PWD\work\input"
$env:PLUGIN_OUTPUT_DIR = "$PWD\work\output"
New-Item -ItemType Directory -Force "$env:PLUGIN_INPUT_DIR\job1" | Out-Null
Copy-Item input-file "$env:PLUGIN_INPUT_DIR\job1\"
dotnet Documentize.OcrImage.dll --task-id job1
Get-ChildItem "$env:PLUGIN_OUTPUT_DIR\job1"
```

The `Documentize.TesseractOcr` plugin: Runs the Tesseract OCR engine directly on image files.

Replace `input-file` with your file and add the options listed above after `--task-id job1`.

```bash
# Linux / macOS (needs the .NET 10 runtime and documentize.lic next to the DLL)
export PLUGIN_INPUT_DIR=./work/input
export PLUGIN_OUTPUT_DIR=./work/output
mkdir -p "$PLUGIN_INPUT_DIR/job1"
cp input-file "$PLUGIN_INPUT_DIR/job1/"
dotnet Documentize.TesseractOcr.dll --task-id job1
ls "$PLUGIN_OUTPUT_DIR/job1"
```

```powershell
# Windows PowerShell
$env:PLUGIN_INPUT_DIR  = "$PWD\work\input"
$env:PLUGIN_OUTPUT_DIR = "$PWD\work\output"
New-Item -ItemType Directory -Force "$env:PLUGIN_INPUT_DIR\job1" | Out-Null
Copy-Item input-file "$env:PLUGIN_INPUT_DIR\job1\"
dotnet Documentize.TesseractOcr.dll --task-id job1
Get-ChildItem "$env:PLUGIN_OUTPUT_DIR\job1"
```

All command line plugins: [Documentize CLI plugins](https://products.documentize.ai/pdf-cli).

## MCP
`run_ocr`: Run OCR on a scanned document or image to extract text as a new PDF. Returns a task ID.

Client configuration (the key comes from your Documentize account):

```json
{
  "mcpServers": {
    "documentize": {
      "url": "https://api.documentize.app/mcp",
      "headers": {
        "Authorization": "Bearer dmk_YOUR_KEY_HERE"
      }
    }
  }
}
```

Tool call (`tools/call`). The tool returns a task id; poll `get_task_status` until it reports 200, then download the file from `uploadFileName`:

```json
{
  "name": "run_ocr",
  "arguments": {
    "fileUrl": "https://example.org/document.pdf"
  }
}
```

About the MCP server: [Documentize MCP server](https://products.documentize.ai/pdf-mcp).

## Related guides

* [Searchable: web app, CLI and MCP](/docs/searchable)
* [Extract text from PDF: web app, CLI, MCP and C#](/docs/extract-text)
* [Search: web app, CLI and MCP](/docs/search)

## Verification status
**Not verified.** This guide is built from the product documentation and the app's own page. The commands and calls above have not been run successfully, so they may need changes, and the file names in them are placeholders. Written on 2026-11-04; a verified guide replaces this page when the app passes the checks.
