# How do you convert PDFs to RAG-ready data?

To convert PDFs to RAG-ready data, extract the text into clean, structured Markdown using a document parser, then split it into chunks for embedding in a vector store. The extraction step is the hardest part: rule-based parsers work for machine-generated PDFs with consistent layouts but fail on [scanned documents](/content/glossary/web-extraction-apis/scanned-vs-text-based-pdfs/index.html), complex tables, or PDFs where multi-column layouts produce garbled reading order.

| Factor                         | PyMuPDF / pdfplumber           | LLM-based extraction | Firecrawl document parsing      |
|-------------------------------|--------------------------------|----------------------|---------------------------------|
| Scanned PDF support           | No                             | Yes                  | Yes (auto or OCR mode)         |
| Table structure               | Partial                        | Semantically understood| Preserved in Markdown           |
| Reading order                 | Can garble multi-column        | Correct              | Correct                         |
| Output format                 | Raw text strings               | Schema-defined JSON   | Structured Markdown              |
| Setup                         | Local install                  | API + prompt engineering| Single API call                  |

Use rule-based parsers for structured, machine-generated PDFs where extraction is deterministic. For mixed corpora (research papers, filings, contracts, reports) where formats vary, [LLM-based extraction](/content/glossary/web-extraction-apis/llm-pdf-data-extraction/index.html) or a managed parsing API produces more consistent chunks.

For web-hosted PDFs, scrape with [document parsing](https://docs.firecrawl.dev/features/document-parsing#document-parsing) converts them to clean Markdown in one API call. For local or non-public documents, upload them to the [`/parse`](https://docs.firecrawl.dev/features/parse) endpoint to get the same Markdown output. The output preserves headings, tables, and lists in a format that chunking libraries like LangChain's `RecursiveCharacterTextSplitter` can split directly. For scanned sources, set `mode: "ocr"` to force OCR on every page before chunking. No local dependencies, no layout configuration needed. See the [PDF parser v2 release](/content/blog/pdf-parser-v2/index.html) for the v2 feature set, or [Fire-PDF](/content/blog/fire-pdf-launch/index.html) for Firecrawl's current Rust-based PDF parsing engine—which routes text-based pages to native extraction and only scanned content through GPU, averaging under 400ms per page on mixed corpora.
