Recognize text (OCR)
recognize_textRun OCR on scanned PDFs or images offline to add an invisible text layer, making Turkish/English text searchable, selectable, and copyable. Use it when pages have no extractable text.
Instructions
Recognizes the text of scanned pages or images (Turkish and English, offline, no upload) and writes a copy of the PDF with an invisible text layer, so the text can be searched, selected and copied. Use it when get_pdf_info lists pages without text or extract_text returns them empty; then run extract_text, search_pdf or export_table on the output. Pages that already have text are left as they are. Scans below 150 dpi are skipped unless force is true, as their text is mostly misread. Takes a few seconds per page. The original is not changed, and an existing output file is only replaced with overwrite: true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the PDF or image. | |
| force | No | Also recognize low-resolution scans. | |
| pages | No | Pages as 1-based numbers and ranges, e.g. "1-3,5". All pages when omitted; a page outside the document is an error. | |
| output | Yes | Absolute path of the new PDF. If the file exists, the call fails unless overwrite is true. | |
| password | No | Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it. | |
| overwrite | No | Allow replacing an existing file (default false). |