PDF to Markdown and Text for LLMs and RAG avatar

PDF to Markdown and Text for LLMs and RAG

Pricing

from $2.00 / 1,000 pdf page with texts

Go to Apify Store
PDF to Markdown and Text for LLMs and RAG

PDF to Markdown and Text for LLMs and RAG

PDF to Markdown and PDF to text for LLMs and RAG. Extract text from PDF URLs: returns one Markdown document per PDF, with reading-order text, headings and real Markdown tables. Handles multi-column pages. Text-based PDFs only, no OCR.

Pricing

from $2.00 / 1,000 pdf page with texts

Rating

0.0

(0)

Developer

Serhii Shevchenko

Serhii Shevchenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Security

Limited permissions

Share

PDF to Markdown for LLMs and RAG

Convert PDF to clean Markdown, ready for an LLM or a RAG pipeline. Give it PDF URLs, and it returns one Markdown document per PDF: text in reading order, headings where they can be detected, and tables as real Markdown tables instead of a jumble of numbers.

Plain PDF to text tools flatten a table into loose lines, so a model can't tell which number belongs to which row. This Actor keeps the rows and columns. It also reads multi-column pages column by column, and takes page numbers and repeated running headers out of the text.

This Actor reads text-based PDFs only. It doesn't do OCR, so scanned PDFs and photos of documents return no text. Those pages are reported and not charged.

What you get

One dataset record per PDF:

FieldMeaning
recordTypedocument, or issue for something that was not read or not charged
sourceUrlThe PDF the document came from
markdownThe whole document as Markdown
pageCountPages in the PDF
pagesChargedPages with extracted text, charged for this PDF
tableCountMarkdown tables in the document
{
"recordType": "document",
"sourceUrl": "https://example.com/report.pdf",
"pageCount": 2,
"pagesCharged": 2,
"tableCount": 1,
"markdown": "# Annual Report\n\nSales grew in every region.\n\n| Region | Sales |\n| --- | --- |\n| North | 120 |\n| South | 95 |"
}

Anything that wasn't read comes back as an issue record with a reason, a message and the pages it applies to, in the same dataset. The run also saves a SUMMARY record with pages read, pages charged and PDFs that failed.

Input example

{
"pdfUrls": ["https://example.com/report.pdf"],
"pages": "1-3",
"maxPages": 50
}
  • pdfUrls: direct http or https links. Up to 100 per run.
  • pages: optional, such as 1-3,7. Applies to every PDF.
  • maxPages: most pages to read in the whole run, across all PDFs. Default 50. It also caps the cost of a run.

The links must be reachable without logging in. Links to private or local addresses aren't accepted.

Pricing

You pay $0.002 per page with extracted text, plus Apify's small start fee of $0.00005 per run. These are not charged:

  • scanned or blank pages
  • pages that couldn't be read
  • pages past maxPages or your spending limit
  • PDFs that failed to download or aren't PDFs

Each of these appears in the results as an issue record. If your spending limit runs out, the Actor stops at that page and reports the pages it didn't read.

Limits

  • Text-based PDFs only. No OCR.
  • 20 MB per PDF, 60 seconds per download, and 2 minutes of processing per PDF.
  • Password-protected PDFs aren't supported.
  • A document's Markdown must fit in one dataset record, about 8 MB. Larger ones are reported and not charged.

What works well, and what doesn't

We tested it on 20 real PDFs: three multi-column documents, invoices, financial statements, government reports and a police records report. We read the output against the source pages. Two-column papers and three-column government text came out in the right order on full pages. Tables that run over several pages are joined: a 16-page report came out with 2 tables, not one per page.

Known weak spots:

  • Text inside images: it isn't read. A page with a large image gets a large_images issue, and it's still charged if it has any text. One test PDF had five such pages, with whole forms stored as pictures.
  • Text in figures: labels in diagrams aren't told apart from body text, so they appear as stray lines, and can come out as false headings. Line chart labels are removed, but bar chart labels aren't.
  • Complex tables: a table with merged cells, nested brackets or math can come out broken or in two pieces. In one paper, a large architecture table came out split and hard to read.
  • Small tables: a borderless table with fewer than three rows of figures stays as plain lines of text.
  • Table headers: a borderless table's header can land in the wrong columns, or stay above the table as a text line.
  • Close columns: two table columns with a narrow gap can end up in one cell, such as € 399,00 21%.
  • Invoices: blocks set side by side, such as billing and shipping addresses, can be merged line by line. This doesn't count as a multi-column page. All the text is there, but the two addresses are interleaved.
  • Short columns: a few lines of columns under a figure can be read straight across instead of column by column.
  • Fixed-width reports: they come out as lines of text, not as tables.
  • Headings: they are worked out from font size and bold text, not from the PDF's structure. Author names often come out as headings, and some real headings are missed. Forms and invoices keep only their largest text as a heading.
  • Footnotes: they move to the end of their page, and aren't linked to their marks. Footnote marks in the text stay as plain numbers.
  • Formulas: math comes out as flat text, and some symbols are lost.
  • Repeated lines: a repeated header or footer stays once, where it first appears, because it may be the only place a company name or a table title is printed. Lines that change on every page, like page numbers, are removed. Anything that repeats outside the top and bottom of the page stays.
  • Languages: only left-to-right text was tested.

Documents are processed in memory and aren't written to logs. The Markdown is saved to your run's dataset, as with any Actor.

Built with Claude, an AI, and tested with real PDFs.