DoclingSharp 8.15.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package DoclingSharp --version 8.15.8
                    
NuGet\Install-Package DoclingSharp -Version 8.15.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DoclingSharp" Version="8.15.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DoclingSharp" Version="8.15.8" />
                    
Directory.Packages.props
<PackageReference Include="DoclingSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DoclingSharp --version 8.15.8
                    
#r "nuget: DoclingSharp, 8.15.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DoclingSharp@8.15.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DoclingSharp&version=8.15.8
                    
Install as a Cake Addin
#tool nuget:?package=DoclingSharp&version=8.15.8
                    
Install as a Cake Tool

DoclingSharp

DoclingSharp is a .NET 8 client library for interacting with Docling (version >1.0.1). It provides two core features:

  • DoclingClient – Extracts content from documents uploaded as IFormFile objects via the Docling API.
  • DocumentChunker – for splitting document content into manageable chunks suitable for embeddings or other processing.

Installation

Install via NuGet:

dotnet add package DoclingSharp

Usage

In your Program.cs or Startup.cs:

builder.Services.AddDocling(c =>
{
    c.DoclingAddress = new Uri("http://localhost:5001");
    c.ChunkMaxCharacters = 2048;
    c.ChunkCharacterOverlap = 128;
});

This sets up both DoclingClient and DocumentChunker with your preferred configuration.

Extract and chunk documents

In a controller, service, or background task:

// Extract content from an uploaded IFormFile
var result = await _doclingClient.ExtractDocumentContentAsync(file);

// Split the content into chunks for embedding or further processing
var documentChunks = _documentChunker.ChunkDocument(result.Markdown);

// Pass the chunks to your embedding engine

Features

  • ExtractDocumentContentAsync: Works with IFormFile inputs for PDFs, DOCX, and other supported formats. Returns structured DoclingResult including Markdown, plain text, JSON, and HTML.
  • DocumentChunker: Splits documents into overlapping chunks to ensure no content is lost between segments, making it ideal for embedding workflows.
  • Fully integrated with IHttpClientFactory and IOptions<T> for clean dependency injection.
  • Configurable chunk sizes and overlap.

Example

var options = new DoclingOptions
{
    DoclingAddress = new Uri("http://localhost:5001"),
    ChunkMaxCharacters = 2048,
    ChunkCharacterOverlap = 128
};

var httpClientFactory = ...; // get via DI or manually
var doclingClient = new DoclingClient(httpClientFactory, Options.Create(options));
var documentChunker = new DocumentChunker(options);

var file = File.OpenRead("example.pdf");
var result = await doclingClient.ExtractDocumentContentAsync(file);
var chunks = documentChunker.ChunkDocument(result.Markdown);

Requirements

  • .NET 8+
  • Docling API >1.0.1
  • Microsoft.Extensions.Http and Microsoft.Extensions.Options
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.17.9 2,964 9/5/2025
8.15.8 175 9/5/2025
8.13.7 167 9/5/2025
8.1.0 264 8/26/2025