PDF to Markdown & Text – Tables and OCR
Pricing
from $2.50 / 1,000 pdf reads
PDF to Markdown & Text – Tables and OCR
Turn PDF URLs into clean Markdown and plain text. Tables come out as real Markdown tables (and as rows), two- and three-column pages are read in order, and scanned pages are read with OCR. $2.50 per 1,000 PDFs.
Pricing
from $2.50 / 1,000 pdf reads
Rating
0.0
(0)
Developer
Joshua White
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
13 days ago
Last modified
Categories
Features
Share
Turn PDF links into Markdown and plain text. Tables come out as real Markdown tables, and also as rows you can load into a spreadsheet. Two- and three-column pages (papers, newsletters, government reports) are read column by column, in order. Scanned pages are read with OCR.
Try it: the input is prefilled with two PDFs: a research paper and a Federal Reserve statistical release. Click Start and the results show in a few seconds.
How to convert PDFs to Markdown
- Paste PDF links, one per line. Each link must download the PDF file itself.
- Leave OCR for scanned pages on
auto. - Click Start, then download the results as JSON, CSV or Excel, or read them through the API.
What you get for each PDF
| Field | What it is |
|---|---|
url, fileName | The link you gave and the file name. finalUrl is set when the link redirected. |
status | ok or error. |
markdown | The whole document as Markdown. Each page starts with <!-- page N -->. Tables are Markdown tables. |
text | The same content as plain text. Table rows are tab-separated lines. |
tables | Every table as { page, rows }, where rows is a list of rows and each row a list of cell texts. The first row is the header. |
pages | Optional (Include each page separately): each page's Markdown and how it was read, text or ocr. |
pageCount, pagesProcessed | Pages in the PDF, and pages read. |
ocrPages, tableCount | Pages read by OCR, and tables found. |
metadata | Title, author, subject, keywords, creator, producer, created and modified dates, when the PDF has them. |
note, error | Plain-English notes (pages skipped, OCR off), or why a PDF failed. |
Example of a table in markdown, from page 31 of Apple's 2023 10-K:
| | September 30, 2023 | Years ended September 24, 2022 | September 25, 2021 ||---|---|---|---|| Net sales: | | | || Products | 298,085 | 316,199 | 297,392 || Services | 85,200 | 78,129 | 68,425 || Total net sales | 383,285 | 394,328 | 365,817 |
How tables are found
Most tables in reports and filings have no grid lines, so the actor doesn't rely on them. It looks for rows whose values line up in columns, then builds the grid from where the values sit on the page. Row labels stay in the first column, section labels ("Net sales:") become their own rows, wrapped labels are joined, and header lines above the numbers become the header row.
We checked this against tables we typed out by hand from 8 pages (Apple and Tesla 10-Ks, a Federal Reserve H.8 release, BEA GDP and EIA energy tables, a Census income table, two research papers): 662 of 666 cells came out in the right row and column.
It works best on tables of numbers. Tables made mostly of text (a two-column list of terms and definitions, for example) come out as paragraphs.
OCR for scanned pages
With OCR on auto, a page goes to OCR when it has almost no text layer and is covered by an image, like a scan or a
photo. Other pages are read from the text layer, which is exact and fast. Set OCR to always when a PDF's text layer
is garbled. OCR uses Tesseract and supports English, German, French, Spanish, Italian, Portuguese and Dutch.
OCR quality depends on the scan. Clean scans of printed pages read well. Faint typewriter copies, handwriting and stamps read poorly.
How much does it cost?
- $2.50 per 1,000 PDFs, including each PDF's first 50 pages.
- $0.05 per 1,000 pages after the first 50 pages of a PDF.
- $3 per 1,000 scanned pages read by OCR. Pages with a text layer are never charged for OCR.
PDFs that fail to download or open are free. A 10-page report costs $0.0025. Apify's $5 monthly free credit covers about 2,000 PDFs. The run's maximum cost caps what you spend: before each PDF, pages and OCR are limited to what the remaining budget covers.
Input example
{"urls": ["https://arxiv.org/pdf/1706.03762","https://www.federalreserve.gov/releases/h8/current/h8.pdf"],"ocr": "auto","ocrLanguage": "eng","maxPagesPerPdf": 500,"includeTables": true,"includeText": true,"includePages": false}
Limits
- Links must be public and must download a PDF. Pages behind a login aren't supported.
- The actor honours each site's robots.txt and paces requests to the same site. Some sites refuse automated
downloads; those PDFs come back with
status: errorand aren't charged. - Files up to 100 MB by default (Max file size, up to 500 MB).
- Password-protected PDFs open when you give the password.
- Very large outputs (over about 8 MB of text in one PDF) are saved to the run's key-value store, and the row links to
them (
markdownUrl,textUrl).
Use it from code
curl -X POST "https://api.apify.com/v2/acts/oldjard~pdf-to-markdown-text-ocr/run-sync-get-dataset-items?token=YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{"urls": ["https://arxiv.org/pdf/1706.03762"]}'