DocWright.Core 1.1.1

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

DocWright.Core

Foundation package for DocWright: measurement primitives, extension points, structured diagnostics, resource limits and the exception taxonomy.

Zero dependencies.

Install

dotnet add package DocWright.Core

You almost certainly want DocWright instead — it includes this package. Install DocWright.Core directly only when you are writing something that plugs into DocWright and does not need the rest of it.

What is in it

Measurement primitivesTwips, Emu, ColorRgb. Word's model is twip-based (1 point = 20 twips, 1 inch = 1440 twips), and DocWright mirrors it with integer arithmetic so results are identical across platforms and framework versions.

using DocWright.Core.Primitives;

Twips margin = Twips.FromInches(1);        // 1440
Twips size   = Twips.FromPoints(11);       // 220

Extension pointsIDocumentReader, IDocumentWriter, ILayoutRenderer, ITextShaper. Implement one to add a format or a renderer of your own and register it with the converter.

DiagnosticsIConversionDiagnostics and ConversionDiagnostic report what a conversion had to approximate, substitute or preserve opaquely, each with a stable diagnostic code.

var diagnostics = new CollectingConversionDiagnostics();
converter.Convert(input, output, new ConvertOptions { Diagnostics = diagnostics });

foreach (var d in diagnostics.Snapshot())
{
    Console.WriteLine($"{d.Code} {d.Severity}: {d.Message}");
}

Resource limitsResourceLimits bounds input size, decompressed size, package entry count, compression ratio, image pixels, nesting depth and wall-clock time. The limits whose worst case is not proportional to input size are on by default.

Exception taxonomy — every failure a caller can act on derives from DocWrightException, so one catch covers the library.

Requirements

.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (20)

Showing the top 5 NuGet packages that depend on DocWright.Core:

Package Downloads
DocWright.Dom

The mutable document model and editing API for DocWright: sections, paragraphs, tables, styles, numbering, theme and settings, tracked changes, content controls and form fields, plus find/replace and {{placeholder}} filling. Markup it does not model is preserved rather than dropped, so a load-and-save round-trip is lossless. Most users should install the DocWright package instead, which includes this one.

DocWright.Fonts

Font discovery, OpenType TTF/OTF/TTC parsing, metric-compatible substitution and Word-compatible text measurement for DocWright. Bundles OFL-licensed fallback faces so output stays reasonable on a machine with no fonts installed, and reports every substitution it makes. Zero dependencies. Most users should install the DocWright package instead, which includes this one.

DocWright.Ole

Compound File Binary (MS-CFB) reader and OLE payload extraction for DocWright — the container format that legacy .doc files, encrypted Office packages and embedded objects all sit inside. Treats its input as untrusted: traversal is bounded and declared sizes are checked before anything is allocated. Zero third-party dependencies.

DocWright.Formats.Html

HTML import and export for DocWright: a tolerant, dependency-free HTML5 parser that recovers from malformed markup the way a browser does, a documented CSS subset, and an HTML writer with self-contained (images inlined as data URIs) and linked output modes. Most users should install the DocWright package instead, which includes this one.

DocWright.Cryptography

Password-protected Office documents for DocWright: ECMA-376 agile and standard encryption (read and write), legacy Word 97 RC4 and RC4 CryptoAPI (read), and document-protection password hashes. Uses only the .NET base class library — no third-party cryptography. Digital signatures are a separate package, DocWright.Signatures.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 832 8/22/2026
1.1.0 847 8/22/2026