PDF to Markdown, Text & JSON Tables - OCR for Scans & Images avatar

PDF to Markdown, Text & JSON Tables - OCR for Scans & Images

Pricing

$4.00 / 1,000 page processeds

Go to Apify Store
PDF to Markdown, Text & JSON Tables - OCR for Scans & Images

PDF to Markdown, Text & JSON Tables - OCR for Scans & Images

Convert PDFs and images (PNG, JPG, TIFF, WebP) to clean Markdown, plain text and JSON tables, page by page. Uses the PDF text layer first, Tesseract OCR for scans. 7 languages. Ideal for RAG, LLM and data-entry pipelines. Files are never stored.

Pricing

$4.00 / 1,000 page processeds

Rating

0.0

(0)

Developer

Jean Swiegers

Jean Swiegers

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Share

PDF to Markdown, Text & JSON Tables – OCR for Scanned PDFs and Images

Convert PDFs, scanned documents and images (PNG, JPEG, TIFF, WebP) to clean Markdown, plain text and JSON tables, one row per page. Digital PDFs are read from their embedded text layer (fast and exact), and pages without text – scans, faxes, photos of documents – automatically go through Tesseract OCR in 7 languages. Detected tables come back both as Markdown tables and as JSON arrays of rows. Built for RAG pipelines, LLM prompts, vector databases, spreadsheets and data-entry automation. $0.004 per page, text layer or OCR, no start fee – you only pay for pages processed successfully.

What you get

One dataset row per page (an image file is one page):

FieldWhat it contains
fileUrl, fileNameSource file URL and file name
fileTypepdf, png, jpeg, tiff or webp (detected from file contents, not the extension)
page, pageCountPage number (1-based) and total pages in the file
statussucceeded or failed
methodtext-layer or ocr
ocrConfidenceAverage OCR word confidence 0–100 (OCR pages only, otherwise null)
markdownPage content as Markdown, with tables as Markdown tables
textPlain text (when includePlainText is on)
tables, tableCountDetected tables as [{ "rows": [["cell", …], …] }] and how many there are
charCount, wordCount, isEmptySize of the extracted text; isEmpty is true if no text was found
durationMsProcessing time for the page
errornull on success, otherwise { code, message }

Dataset views in Apify Console: Pages (overview) and Tables (one row per table). A PAGES_PROCESSED record and a RUN_SUMMARY record in the key-value store hold the run totals.

How much does it cost?

$0.004 per page – the same price whether the page is read from the text layer or with OCR. An image file counts as one page. You only pay for successful results: failed files and failed pages are free, there is no start fee, and there are no extra platform usage charges.

PagesPrice
100$0.40
1,000$4.00
10,000$40.00

Use pageRange, maxPagesPerFile and a maximum cost per run in Apify Console to keep spend predictable. The Actor stops processing new pages when the maximum is reached.

Use cases

  • 🤖 RAG & AI agents – turn document libraries into per-page Markdown for embeddings and retrieval.
  • 🧾 Invoices, statements & reports – pull tables of figures into JSON or CSV.
  • 🗂️ Digitize scanned archives – get searchable text from scanned PDFs, faxes and photos of documents.
  • 📊 Data extraction – send extracted tables to Google Sheets, Airtable or your database via integrations.
  • 🔍 Compliance & search – index contracts and policies.

How to convert PDF to Markdown

  1. Add direct links to your files in File URLs – public URLs, pre-signed S3 or Google Drive download links, or Apify key-value store record URLs.
  2. Leave OCR mode on auto (text layer first, OCR only for pages without text), and pick the OCR languages in your documents.
  3. Click Start, then download the results as JSON, CSV or Excel, or fetch them via the API.

Example input

{
"fileUrls": [
{ "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" },
{ "url": "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png" }
],
"ocrMode": "auto",
"ocrLanguages": ["eng", "deu"],
"pageRange": "1-10",
"maxPagesPerFile": 50,
"includePlainText": true
}

All input options:

FieldDefaultWhat it does
fileUrlsa sample PDF and a sample imageDirect links to PDF, PNG, JPEG, TIFF or WebP files
ocrModeautoauto (OCR only pages without text), always (OCR every page) or never
ocrLanguages["eng"]eng, deu, fra, spa, por, ita, nld. More languages = slower OCR
pageRangeall pagesPDF pages to process, e.g. 1-3,5,10-
maxPagesPerFile50Safety limit per file (1–2,000)
includePlainTexttrueAdd a plain-text field next to the Markdown
ocrDpi200Rendering resolution for OCR of scanned PDF pages (72–400)
maxFileSizeMb50Larger files are rejected (1–200 MB)
maxConcurrency2Files processed in parallel (1–8)

Example output

A scanned (image-only) PDF page with a table, read with OCR in a test run:

{
"fileUrl": "https://example.com/scanned-report.pdf",
"fileName": "scanned.pdf",
"fileType": "pdf",
"page": 1,
"pageCount": 1,
"status": "succeeded",
"method": "ocr",
"ocrConfidence": 94,
"markdown": "Quarterly Report 2026\n\nRevenue grew strongly across all regions. The table below summarises results.\n\n| Region | Q1 Revenue | Q2 Revenue | Growth |\n| --- | --- | --- | --- |\n| Gauteng | R 1,200,000 | R1,450,000 | 20.8% |\n| Western Cape | R 980,000 | R 1,010,000 | 3.1% |\n| KwaZulu-Natal | R 640,000 | R 702,000 | 9.7% |\n| Eastern Cape | R 310,000 | R 355,000 | 14.5% |",
"tables": [
{
"rows": [
["Region", "Q1 Revenue", "Q2 Revenue", "Growth"],
["Gauteng", "R 1,200,000", "R1,450,000", "20.8%"],
["Western Cape", "R 980,000", "R 1,010,000", "3.1%"],
["KwaZulu-Natal", "R 640,000", "R 702,000", "9.7%"],
["Eastern Cape", "R 310,000", "R 355,000", "14.5%"]
]
}
],
"tableCount": 1,
"wordCount": 45
}

Failed files and pages get "status": "failed" and an error object with a code and a message (for example a download error, an unsupported file type or a password-protected PDF).

Privacy

Files are downloaded to the run's temporary disk, processed and deleted straight away. Only the extracted output is saved, in your own dataset.

FAQ

Does it work on scanned PDFs? Yes. With ocrMode: auto, any page with no usable text layer is rendered and read with Tesseract OCR. Pages that already have text are not OCR'd.

How accurate is OCR? Tesseract works well on clean scans at 200–300 DPI. Low-quality photos, handwriting and unusual fonts reduce accuracy – check ocrConfidence on each page.

How fast is it? In our test runs a 30-page text PDF took about 5 seconds, while OCR of a 10-page scanned paper (ocrMode: always) took about 3 minutes at the default 1 GB memory. OCR is the slow part.

Are complex tables supported? Simple and medium tables (aligned columns, with or without borders) are rebuilt well. Merged cells and nested tables may be flattened. The full text is always returned, so no content is lost.

Can it read password-protected PDFs? No – the file fails with a clear error and is not charged.

Can it read Word, Excel or HTML files? No. Supported inputs are PDF, PNG, JPEG, TIFF and WebP.

How do I process files from Google Drive or S3? Use a direct download link or a pre-signed URL.

Something broke? Open an issue on the Actor's Issues tab with the run ID.