OCR a scanned PDF or image
ocr_pdfQueue a scanned PDF, PNG or JPEG for OCR with OCRmyPDF and Tesseract.
The result is the same document with a searchable text layer, as PDF/A
by default. Pass the file as base64 in content_base64 (up to 4 MB) or
as a download link in file (up to 25 MB), and its name in filename.
Up to 200 pages; an image is one page.
Returns job_id, status, pages and credits. Call
get_ocr_result with the job_id until status is succeeded or
failed; a job is stopped after 15 minutes.
Requires an API key. Costs 2 credits per page, charged now and refunded if the job fails. The result is kept for 7 days.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | The file as a download link, instead of `content_base64`. In ChatGPT, pass the user's uploaded file here. Other clients can set `download_url` to a public https URL. | |
| mode | No | Pages that already have text: skip them (the default), redo an earlier OCR layer, or force OCR on every page as an image. | skip |
| deskew | No | Straighten crooked pages. Not with mode=redo. | |
| filename | Yes | The file name with its extension: .pdf, .png, .jpg or .jpeg. | |
| language | No | The document's language: eng, deu, spa or fra. | eng |
| output_type | No | pdfa (PDF/A-2b, the default) or pdf. | pdfa |
| rotate_pages | No | Turn pages that are upside down or sideways. | |
| content_base64 | No | The file content, base64-encoded. Up to 4 MB before encoding. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||