ocr_pdf
Adds an invisible searchable text layer to scanned PDFs so text can be searched, selected and extracted. Keeps page images and supports language selection for non-English documents.
Instructions
Add an invisible text layer to a scanned PDF so its text can be searched, selected and extracted. Use this before extract_pdf_text or pdf_to_word on a scan or photographed document, and set lang when the text is not English. The page images are kept, so the output is about the same size as the input, and pages that already have text are left untouched. Takes roughly 2-10 seconds per page. Scans at 300 DPI or higher read well; below 150 DPI accuracy degrades badly. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file": "<file>"
},
"name": "ocr_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute path to the scanned PDF. | |
| lang | No | Language of the document's text as a Tesseract code: eng (English), rus (Russian), spa (Spanish), ita (Italian), uzb (Uzbek, Latin script), uzb_cyrl (Uzbek, Cyrillic) or kaz (Kazakh). For mixed documents join two with '+', for example rus+eng. Any other value is rejected. Defaults to eng. | eng |
| output_path | No | Absolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix. |