Kck.Documents.Abstractions 5.0.0

dotnet add package Kck.Documents.Abstractions --version 5.0.0
                    
NuGet\Install-Package Kck.Documents.Abstractions -Version 5.0.0
                    
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="Kck.Documents.Abstractions" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kck.Documents.Abstractions" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Kck.Documents.Abstractions" />
                    
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 Kck.Documents.Abstractions --version 5.0.0
                    
#r "nuget: Kck.Documents.Abstractions, 5.0.0"
                    
#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 Kck.Documents.Abstractions@5.0.0
                    
#: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=Kck.Documents.Abstractions&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Kck.Documents.Abstractions&version=5.0.0
                    
Install as a Cake Tool

Kck.Documents.Abstractions

Provider-agnostic document processing contracts for Excel generation, CSV export, and image resizing — implement with the ClosedXML or SkiaSharp providers.

Installation

dotnet add package Kck.Documents.Abstractions

Quick Start

using Kck.Documents.Abstractions;

// Program.cs — register concrete providers
builder.Services.AddKckDocumentsClosedXml();   // IExcelService + ICsvExporter
builder.Services.AddKckDocumentsSkiaSharp();  // IImageProcessor

public sealed record OrderRow(Guid Id, string Customer, decimal Total);

// Generate Excel / CSV files from a list
public class ReportHandler(IExcelService excel, ICsvExporter csv)
{
    public async Task<byte[]> ExportOrdersExcelAsync(IReadOnlyList<OrderRow> rows, CancellationToken ct)
    {
        DocumentResult result = await excel.CreateFromDataAsync(rows, worksheetName: "Orders", ct: ct);
        return result.Content; // also: result.ContentType, result.FileName
    }

    public async Task<byte[]> ExportOrdersCsvAsync(IReadOnlyList<OrderRow> rows, CancellationToken ct)
    {
        DocumentResult result = await csv.ExportAsync(rows, fileName: "orders.csv", ct: ct);
        return result.Content;
    }
}

// Resize an uploaded image
public class AvatarService(IImageProcessor processor)
{
    public Task<byte[]> ThumbnailAsync(Stream imageStream, CancellationToken ct) =>
        processor.ResizeAsync(imageStream, new ImageProcessingOptions { Width = 200, Height = 200, OutputFormat = "webp" }, ct);
}

Options

There is no configuration section; behaviour is set per call.

Setting Where Default
Worksheet name CreateFromDataAsync(..., worksheetName) "Sheet1"
CSV file name ExportAsync(..., fileName) "export.csv"
Resize size / aspect ratio ImageProcessingOptions.Width, Height, MaintainAspectRatio aspect ratio kept
Output format ImageProcessingOptions.OutputFormat / ConvertFormatAsync(..., targetFormat) — SkiaSharp provider: jpeg (jpg), png, webp jpeg
Quality (JPEG / WebP) ImageProcessingOptions.Quality 80

Resources

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Kck.Documents.Abstractions:

Package Downloads
Kck.Documents.ClosedXml

ClosedXML-backed IExcelService and ICsvExporter implementations. Generates Excel workbooks from typed collections with auto-generated headers, and exports data to CSV format. Registered via AddKckDocumentsClosedXml().

Kck.Documents.ImageSharp

SixLabors.ImageSharp-backed IImageProcessor for server-side image operations. Supports resize (with aspect-ratio preservation), format conversion (JPEG, PNG, WebP, GIF, BMP), and image dimension reading. Registered via AddKckDocumentsImageSharp().

Kck.Documents.SkiaSharp

SkiaSharp-backed IImageProcessor for server-side image operations. Supports resize (with aspect-ratio preservation), format conversion (JPEG, PNG, WebP output; JPEG, PNG, WebP, GIF, BMP, ICO input), header-only dimension reading and a decoder-bomb pixel limit. Registered via AddKckDocumentsSkiaSharp(). On Linux add SkiaSharp.NativeAssets.Linux.NoDependencies to the application.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 287 11/2/2026
4.8.0 591 10/31/2026
Loading failed