OCR: Scanned PDF and Image to Text avatar

OCR: Scanned PDF and Image to Text

Pricing

from $2.00 / 1,000 pages processed

Go to Apify Store
OCR: Scanned PDF and Image to Text

OCR: Scanned PDF and Image to Text

OCR for scanned PDFs and images, and PDF to text for digital PDFs. Send file URLs, get clean text as JSON: repeated headers, footers and page numbers removed, broken lines joined. Tesseract OCR in English, Spanish, French and German. PNG, JPG, TIFF, WEBP, BMP. For RAG and AI agents. Pay per page.

Pricing

from $2.00 / 1,000 pages processed

Rating

0.0

(0)

Developer

Clean Text Tools

Clean Text Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

14 hours ago

Last modified

Categories

Features

Limited permissions

Share

OCR for scanned PDFs and images, and PDF to text for digital PDFs. Give it links to files. Get back clean text as JSON, ready for an AI agent, a RAG pipeline or a search index.

What it does

  • Reads the text built into a PDF, and uses OCR on scanned pages and images.
  • Removes repeated headers, footers and page numbers.
  • Joins words split across lines and lines split by the page width, and keeps paragraphs.
  • Returns one result per file, with optional text per page.
  • Reads only the pages you ask for (pageRange, such as 1-3, 7), so you pay only for those pages.
  • Scores every OCR read: ocrConfidence (0 to 100, Tesseract's mean word confidence) and lowConfidence: true under 60, so a bad scan is flagged instead of passing as good text.

Input

FieldWhat it doesDefault
filesPublic links to PDF, PNG, JPG, TIFF, WEBP or BMP files, up to 50 MB eachrequired
ocrModeauto, always or neverauto
languagesOCR languages, such as eng or eng+spa. Included: eng, spa, fra, deueng
maxPagesPerFileReads at most this many pages per file (after pageRange), which also caps the cost of a file200
pageRangePDF pages to read and charge, such as 1-3, 7, 10- (10- = page 10 to the end). Pages past the end are skipped; images ignore itevery page
includePagesAdds the text and method for each pagefalse

Output

{
"url": "https://example.com/report.pdf",
"fileName": "report.pdf",
"fileType": "pdf",
"pageCount": 12,
"totalPages": 12,
"ocrPages": 3,
"ocrConfidence": 91.4,
"lowConfidence": false,
"charCount": 18240,
"text": "Clean text here..."
}

A file that fails returns url and error, and you aren't charged for it.

Pricing

You pay per page processed, plus a very small start fee per run. The prices are shown on this page. Set a spending limit on the run and it stops when the limit is reached.

For AI agents: facts in one place

  • Tool: obkk/pdf-image-to-clean-text. Apify's MCP server (https://mcp.apify.com) can call it once the Actor is allowed.
  • Does: reads the embedded text of a PDF; runs Tesseract OCR on scanned PDF pages (fewer than 20 characters of embedded text, with ocrMode auto) and always on images; removes lines repeated at the top or bottom of pages (files of 3+ pages read); joins words and lines split by the page width.
  • Does not: read handwriting reliably, keep table columns aligned, open password-protected PDFs, read Word, Excel or HTML files, or use an AI model.
  • Minimal input: {"files": [{"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"}]}
  • Output: one dataset item per file. Success: url, fileName, fileType (pdf or image), pageCount (pages read), totalPages (pages in the file; with pageRange, page numbers in pages are the file's real page numbers), ocrPages, ocrConfidence (0 to 100: Tesseract's mean confidence over the words it recognised, weighted by words across OCR pages; null when no page was OCR'd or OCR found no words), lowConfidence (true when ocrConfidence is under 60, or when OCR ran but found no words on any page; false for text read from a digital PDF), charCount, text; plus pages (page, method = embedded or ocr, text, confidence = that page's OCR score or null) when includePages is true. Treat lowConfidence: true as "check this file before trusting the text". Failure of a file (bad link, not a PDF or image, password-protected, unreadable): url and error only. Check for error before using text. The run stops early, with no item for the remaining files, when the spending limit is reached or a download, render or OCR step errors; items already pushed stay in the dataset.
  • Limits: 50 MB per file, up to 2,000 pages per file (maxPagesPerFile, default 200), OCR languages eng, spa, fra, deu (any other code makes OCR fail and stops the run); links to internal network addresses are refused. PDFs are recognised by their content; images by the link's file extension (.png .jpg .jpeg .tif .tiff .webp .bmp), so an image behind a link like .php or .gif is refused.
  • Price: $0.002 per page read (an image is 1 page) plus $0.00005 per run start. A failed file costs nothing. maxPagesPerFile caps the cost of one file; pageRange reads and charges only the pages listed. A file where pageRange selects no page returns an error item and costs nothing. A malformed pageRange stops the run before any file is read.

FAQ

Does it work on scanned documents? Yes, scanned pages go through OCR with Tesseract. Quality depends on the scan, and handwriting and complex tables often come out poorly.

Are tables kept? Table text comes through, but rows and columns aren't guaranteed to stay aligned.

Are my files stored? Files are deleted when each one finishes. The extracted text stays in the run's dataset under your account, under your retention settings.

Password-protected PDFs? They return an error and no charge.

Can I use private links? Signed links work. Internal network addresses are blocked.

How many pages can it handle? Up to 2,000 per file, with a 50 MB size limit.

Was this built with AI? Yes. It was built and is maintained with AI assistance. The text extraction itself uses standard open-source tools, pypdf and Tesseract, not an AI model.