AI

DocumentExtractionClient (preview): Extracting documents in .NET

.NET Blog Luis Quintanilla
AI

A preview of DocumentExtractionClient in Microsoft.Extensions.DocumentExtraction gives .NET apps a single API that turns PDFs, scans and Office files into one ExtractionDocument structure, shipped with swappable starter providers from the .NET AI Community Toolkit.

Key points

  • ExtractAsync takes a stream, an identifier and a media type, and returns an ExtractionDocument tree of sections.
  • Sections hold text, table and image elements, and each element carries Sources pointing to page and region.
  • Starter providers: in-process PdfPig, any image-capable IChatClient, Azure Content Understanding, Document Intelligence and Mistral OCR.
  • Providers derive from DocumentExtractionClient, so swapping one leaves extraction and ingestion code untouched.
  • Results flow into Microsoft.Extensions.DataIngestion for chunking and Microsoft.Extensions.VectorData for search.
  • .NET 11 SDK is required; Azure providers sign in with DefaultAzureCredential, so no keys sit in code.

Why it matters

For teams that wrote glue code per parser — one path for PdfPig, another for Document Intelligence, a third for a hosted OCR API — the value is the shape of the abstraction, not any single provider. It repeats the IChatClient pattern from Microsoft.Extensions.AI: one client type, interchangeable implementations, middleware and DI on top, wiring straight into DataIngestion and VectorData.

Before adopting it, weigh the preview labels on both the abstraction and the toolkit providers, and check the .NET 11 SDK requirement. Provider choice is not neutral: PdfPig reads only an existing text layer, vision-model output needs review, and hosted services send the document off your machine.

Real-world use

  • A RAG pipeline that chunks invoices and contracts at their headings so each chunk covers a single topic.
  • An agentic workflow that answers questions over scanned reports and points to the page each answer came from.
  • A data-entry or archiving service that pulls tables out of forms while keeping merged header cells intact.
  • An internal search index over mixed PDFs and Office documents where the parser can change without touching downstream code.

This summary was generated by the agent from the original post on .NET Blog. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message