Microsoft's .NET team released a preview of DocumentExtractionClient on November 24, 2026. The new type ships in the Microsoft.Extensions.DocumentExtraction package and gives .NET apps a single programming model for reading the content and structure of PDFs, scanned pages, images and Office files.
Until now, every parser or cloud OCR service shipped a separate SDK with separate result objects, so changing tools meant rewriting the code that consumed the output.
The new abstraction follows the same idea as IChatClient in Microsoft.Extensions.AI: one shared contract, swappable providers and middleware on top. A set of starter providers arrives alongside it in the .NET AI Community Toolkit.
What DocumentExtractionClient does
The core method is ExtractAsync. You pass it a stream together with a file name and media type, and it returns an ExtractionDocument, which is a tree of sections holding text, tables and images. The shape is the same no matter which provider did the reading.
- Structure: headings and paragraphs, so the outline of the document is kept.
- Tables: a grid where every cell knows its row, column and span, so merged header cells survive.
- Figures: position on the page and, where the provider supports it, a description.
- Sources: the page, and often a polygon on that page, for each element, which makes citations and highlighting possible.
Because sections can nest, a simple loop over the top-level sections may miss content. The preview adds EnumerateContent, which walks the whole tree in reading order and returns every non-section element.
Starter providers
Five providers are available in preview through the community toolkit, each in its own package:
- PdfPig: runs inside your process and suits PDFs that already have a text layer. It is fast but cannot read scans.
- Vision language model: plugs into an image-capable IChatClient, running locally or in the cloud, and can read scans and photos, though Microsoft advises reviewing its output.
- Azure Content Understanding: OCR, layout, tables and figures, with analyzers you can customize.
- Azure AI Document Intelligence: OCR, layout, tables and page coordinates.
- Mistral OCR: quick OCR to Markdown through Microsoft Foundry or the Mistral API.
Teams can also write their own provider by deriving from DocumentExtractionClient and implementing ExtractAsync. A custom provider plugs into the same dependency injection, middleware and ingestion code as the built-in ones.
Middleware and the data ingestion pipeline
Since every provider shares one base type, any of them can be wrapped with extra behavior, much as you wrap a chat client.
The .NET blog shows a fallback that reads a PDF with PdfPig first and, if almost no text comes back, sends the same bytes to an OCR service. The calling code never needs to know the file was a scan.
Custom middleware derives from DelegatingDocumentExtractionClient. The same approach could route table-heavy files to a layout-aware service and photos to a vision model.
Extraction is designed as the first step of Microsoft.Extensions.DataIngestion, which splits documents into chunks and stores them in a vector database. In the sample, chunks split at real headings and tables become Markdown, so search results carry clean, topic-sized context for retrieval-augmented generation.
For now you copy a small reader class from the samples to connect the two, and Microsoft says it plans to make that simpler.
What it means for developers
The biggest benefit is freedom to change your mind. You can start with PdfPig on a laptop at no cost, test a hosted service on your own documents, and switch without touching the code that reads the results. That lowers the risk of tying an app to one vendor's object model early.
Provider choice still matters for quality and privacy. In Microsoft's own test, PdfPig returned a table as loose lines, while Content Understanding and the vision model found the grid. Every cloud-based option, a remotely hosted vision model among them, sends the document off your machine, which may rule it out for regulated data.
Keep in mind this is an early preview, with diagnostic suppressions needed to compile and APIs that may change. It fits prototypes and internal tools better than production systems for now. If you are already on .NET 11, the samples run as single C# files.
How to get started
You need the .NET 11 SDK. Ollama is optional for the local vision and embedding samples, and an Azure subscription with the Azure Developer CLI is optional for the cloud providers. Microsoft's samples repository can also be opened in GitHub Codespaces, where the container comes with .NET 11 and Ollama models ready.
Each sample is one file you run with dotnet run, covering first extraction, provider comparison, tables and sources, the scan fallback and ingestion. Bugs in the core client go to the dotnet/extensions repository, and provider issues go to the .NET AI Community Toolkit.
Conclusion
DocumentExtractionClient brings the familiar Microsoft.Extensions pattern to document parsing, giving .NET developers one result type across local parsers, vision models and Azure services. It is still a preview, but it already offers a clean path from raw PDFs and scans to structured, cited content for search and AI apps.
Sources
See my articles more often when you search Google.
