DocWright.Core
1.1.1
dotnet add package DocWright.Core --version 1.1.1
NuGet\Install-Package DocWright.Core -Version 1.1.1
<PackageReference Include="DocWright.Core" Version="1.1.1" />
<PackageVersion Include="DocWright.Core" Version="1.1.1" />
<PackageReference Include="DocWright.Core" />
paket add DocWright.Core --version 1.1.1
#r "nuget: DocWright.Core, 1.1.1"
#:package DocWright.Core@1.1.1
#addin nuget:?package=DocWright.Core&version=1.1.1
#tool nuget:?package=DocWright.Core&version=1.1.1
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 primitives — Twips, 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 points — IDocumentReader, IDocumentWriter, ILayoutRenderer,
ITextShaper. Implement one to add a format or a renderer of your own and register it with
the converter.
Diagnostics — IConversionDiagnostics 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 limits — ResourceLimits 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 | Versions 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. |
-
.NETFramework 4.8
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
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.
See https://github.com/albahadly/DocWright/releases for release notes.