Skip to main content

Quickstart

This page gets you from a blank terminal to a working PDF extraction in as few steps as possible. No prior knowledge of MuPDF.NET required.

1. Create a project


2. Install PDF4LLM


3. Add a PDF

Copy any PDF into the project folder and note its filename. If you don’t have one to hand, download a sample:

4. Convert to Markdown

Replace the contents of Program.cs with:
Run it:
You should see the PDF content printed to the console as Markdown — headings prefixed with #, tables as pipe syntax, bold and italic preserved.

5. Save the output

Write the result to a file instead of printing:

6. Try the other output formats

Switch the extraction method to see different representations of the same document. Plain text — same layout analysis, no Markdown syntax:
JSON — full layout structure with bounding boxes and block types:

7. Extract specific pages

Pass a zero-based list to process only the pages you need:

You’re up and running

That’s the core loop: open a Document, call an extractor method, close the document. Everything else — OCR, image extraction, LlamaIndex loading, form fields — builds on this pattern.