Ank.DocToolkit
0.61.0
dotnet add package Ank.DocToolkit --version 0.61.0
NuGet\Install-Package Ank.DocToolkit -Version 0.61.0
<PackageReference Include="Ank.DocToolkit" Version="0.61.0" />
<PackageVersion Include="Ank.DocToolkit" Version="0.61.0" />
<PackageReference Include="Ank.DocToolkit" />
paket add Ank.DocToolkit --version 0.61.0
#r "nuget: Ank.DocToolkit, 0.61.0"
#:package Ank.DocToolkit@0.61.0
#addin nuget:?package=Ank.DocToolkit&version=0.61.0
#tool nuget:?package=Ank.DocToolkit&version=0.61.0

DocToolkit
HTML in. Word and PDF out. Nothing else installed.
You have a Linux container, a Word template and a PDF due on Friday. The usual answers are a headless Chrome, LibreOffice, or a licence with a revenue threshold.
DocToolkit is one NuGet package instead. It is pure managed code. It restores, builds and runs the same on your laptop and in the container.
Install
dotnet add package Ank.DocToolkit
// HTML in, a Word document and a PDF out. No browser, no LibreOffice, nothing to install.
byte[] docx = await HtmlToDocxConverter.ConvertAsync("<h1>Invoice 2026-114</h1>");
byte[] pdf = await HtmlToPdfConverter.ConvertAsync("<h1>Invoice 2026-114</h1>");
// Read a document back, edit one you were given, and lock it when you are done.
string text = DocxEditor.ExtractText(docx);
byte[] locked = PdfEditor.Protect(pdf, new PdfProtection { UserPassword = "s3cret" });
That is the whole setup: no browser download, no apt-get, no config file. It targets net8.0 and
net10.0.
Numbers

Every bar takes a minute to reproduce. Add the package to an empty net8.0 app, build it, and
measure runtimes/. The commands are in
Measured against the alternatives.
What it does
| Convert | HTML and Markdown to DOCX and PDF; DOCX to HTML, Markdown and PDF; XLSX to CSV, HTML and PDF; PPTX to PDF; legacy Word 97-2003 .doc to DOCX; legacy PowerPoint 97-2003 .ppt to PDF |
| Edit | create and edit DOCX, XLSX and PPTX; fill templates and forms, including one row per record; insert images; read text back out |
| page count, merge, split, extract, rotate, reorder, insert; read text; read and stamp document information | |
| Protect | password-protect and unprotect PDF, DOCX, XLSX and PPTX |
| From ↓ / To → | CSV | DOC | DOCX | HTML | Markdown | PPTX | XLSX | |
|---|---|---|---|---|---|---|---|---|
| CSV | — | · | · | · | · | · | · | · |
| DOC | · | — | ✅ | · | · | · | · | · |
| DOCX | · | · | — | ✅ | ✅ | ✅ | · | · |
| HTML | · | · | ✅ | — | · | ✅ | · | · |
| Markdown | · | · | ✅ | · | — | ✅ | · | · |
| · | · | · | · | · | — | · | · | |
| PPTX | · | · | · | · | · | ✅ | — | · |
| XLSX | ✅ | · | · | ✅ | · | ✅ | · | — |
A ✅ is a converter that ships; · is a pair with no converter, not a promise about one. Read a row as "from this format, into these".
FAQ
Does it need Chrome or LibreOffice? No. Every PDF is rendered from a real Word document, in managed code.
Can I use it at work? Yes. It is MIT licensed, and every dependency is MIT, Apache-2.0 or BSD.
Does it reach the network? Not by default. Remote images are the one opt-in, and that stays bounded.
Is it trim-safe and ready for native AOT?
Yes. CI publishes a trimmed and a native-AOT app and runs both. ClosedXML still emits warning
IL2090.
What will it not do? CSS layout, mixed page setups and multi-line headers, among a few others. The list is in Known limitations.
Learn more
- Guides: getting started, HTML, Markdown, Word, spreadsheets, dependency injection and production.
- Reference: every capability, every overload, the caveats and the migration notes.
- API reference, generated from the source.
- Source, samples and issues on GitHub.
Every type in the package
Each name links to its API page.
Core
DocToDocxConverter, DocxToHtmlConverter, DocxToMarkdownConverter, DocxToPdfConverter, DocxToPdfPreflight, DocxToPdfPreflightFinding, DocxToPdfPreflightReport, DocxToPdfRisk, HtmlToDocxConverter, HtmlToPdfConverter, MarkdownEditor, MarkdownHeading, MarkdownToDocxConverter, MarkdownToPdfConverter, PptxToPdfConverter, XlsxToCsvConverter, XlsxToHtmlConverter, XlsxToPdfConverter
Word (DOCX)
DocxBlock, DocxComment, DocxCompare, DocxEditor, DocxForm, DocxFormField, DocxFormIssue, DocxFormIssueKind, DocxFormKey, DocxFormReport, DocxFormValidation, DocxFormValue, DocxFormValueKind, DocxMailMerge, DocxMailMergeBatchItem, DocxMailMergeBlockData, DocxMailMergeBlockReport, DocxMailMergeBlockResult, DocxMailMergeField, DocxMailMergeFieldStatus, DocxMailMergeFileBatchItem, DocxMailMergeIssue, DocxMailMergeIssueKind, DocxMailMergeReport, DocxMailMergeResult, DocxMailMergeTableRowGroup, DocxMailMergeTemplate, DocxReview, DocxReviewReport, DocxRevision, DocxRevisionKind
PdfBounds, PdfEditor, PdfEncryptionStrength, PdfImage, PdfMetadata, PdfProtection, PdfWord
PowerPoint (PPTX)
Excel (XLSX)
PivotDataField, PivotFunction, WorkbookEditor, XlsxComment, XlsxFormat, XlsxFormula, XlsxFormulaCell, XlsxFormulaInspection, XlsxFreeze, XlsxHighlight, XlsxHyperlink, XlsxPageOrientation, XlsxPageSetup, XlsxRule, XlsxRuleKind, XlsxSheet, XlsxSparkline, XlsxSparklineKind, XlsxTable, XlsxTableStyle, XlsxValidation, XlsxValidationKind
Shared types
ChartData, ChartSeries, ChartType, ConversionLossKind, ConversionResult<T>, ConversionWarning, DocToolkitTelemetry, DocumentConversionException, DocumentMetadata, DocumentSignatureInfo, DocumentSignatureStatus, DocumentSignatureValidationOptions, DocumentSignatureValidationReport, DocumentSignatureValidationResult, DocxHeader, DocxHeaderSegment, HeaderAlignment, HtmlToPdfOptions, LegacyDocOptions, PageSetup, PdfFontOptions, RemoteImageOptions
| Product | Versions 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 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. |
-
net10.0
- AngleSharp (>= 1.8.3)
- ClosedXML (>= 0.105.1)
- DocumentFormat.OpenXml (>= 3.5.1)
- HtmlToOpenXml.dll (>= 3.5.0)
- OfficeIMO.Excel (>= 3.5.3)
- OfficeIMO.Excel.Pdf (>= 3.5.3)
- OfficeIMO.PowerPoint (>= 3.5.3)
- OfficeIMO.PowerPoint.Pdf (>= 3.5.3)
- OfficeIMO.Security (>= 3.5.3)
- OfficeIMO.Word (>= 3.5.3)
- OfficeIMO.Word.Html (>= 3.5.3)
- OfficeIMO.Word.Markdown (>= 3.5.3)
- OfficeIMO.Word.Pdf (>= 3.5.3)
- PdfPig (>= 0.1.16)
- PDFsharp (>= 6.2.4)
- SixLabors.Fonts (= 1.0.1)
- System.Security.Cryptography.Xml (>= 10.0.13)
-
net8.0
- AngleSharp (>= 1.8.3)
- ClosedXML (>= 0.105.1)
- DocumentFormat.OpenXml (>= 3.5.1)
- HtmlToOpenXml.dll (>= 3.5.0)
- OfficeIMO.Excel (>= 3.5.3)
- OfficeIMO.Excel.Pdf (>= 3.5.3)
- OfficeIMO.PowerPoint (>= 3.5.3)
- OfficeIMO.PowerPoint.Pdf (>= 3.5.3)
- OfficeIMO.Security (>= 3.5.3)
- OfficeIMO.Word (>= 3.5.3)
- OfficeIMO.Word.Html (>= 3.5.3)
- OfficeIMO.Word.Markdown (>= 3.5.3)
- OfficeIMO.Word.Pdf (>= 3.5.3)
- PdfPig (>= 0.1.16)
- PDFsharp (>= 6.2.4)
- SixLabors.Fonts (= 1.0.1)
- System.Security.Cryptography.Xml (>= 10.0.13)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Ank.DocToolkit:
| Package | Downloads |
|---|---|
|
Ank.DocToolkit.Extensions.DependencyInjection
Dependency-injection registration for Ank.DocToolkit. services.AddDocToolkit() registers one injectable interface per capability - conversion between HTML, Markdown, DOCX, PDF, XLSX and PPTX, plus the DOCX/XLSX/PPTX/PDF editors - over the same pure-managed logic: no browser, no Chromium, no native binaries, no LibreOffice. For ASP.NET Core and worker-service consumers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.61.0 | 84 | 11/13/2026 |
| 0.60.1 | 175 | 11/10/2026 |
| 0.60.0 | 184 | 11/9/2026 |
| 0.59.0 | 379 | 11/3/2026 |
| 0.58.0 | 351 | 11/3/2026 |
| 0.57.3 | 300 | 10/16/2026 |
| 0.57.2 | 384 | 10/3/2026 |
| 0.57.1 | 496 | 9/3/2026 |
| 0.57.0 | 235 | 9/3/2026 |
| 0.56.0 | 859 | 9/3/2026 |
| 0.55.0 | 233 | 9/2/2026 |
| 0.54.0 | 407 | 9/2/2026 |
| 0.53.0 | 217 | 9/2/2026 |
| 0.52.0 | 351 | 9/2/2026 |
| 0.51.0 | 133 | 9/2/2026 |
| 0.50.0 | 451 | 9/2/2026 |
| 0.49.0 | 321 | 9/1/2026 |
| 0.48.0 | 379 | 9/1/2026 |
| 0.47.0 | 287 | 9/1/2026 |
| 0.46.0 | 414 | 8/31/2026 |
## [0.61.0](https://github.com/Ank-KhoaHo/DocToolkit/compare/v0.60.1...v0.61.0) (2026-11-13)
A Word form can now say which of its fields are locked before you fill it. The package page on
nuget.org also gets a short front page; the full reference moved, unchanged, to the
[Reference](https://ank-khoaho.github.io/DocToolkit/guides/reference.html) page of the docs site.
### Added
* **Core:** `DocxFormField.IsLocked` is true when a content control's content is locked (`w:lock` set to `contentLocked` or `sdtContentLocked`), which is exactly when `DocxForm.Fill` refuses to write it. A form UI can grey the field out instead of finding out from an exception. ([#551](https://github.com/Ank-KhoaHo/DocToolkit/issues/551)) ([1a6e405](https://github.com/Ank-KhoaHo/DocToolkit/commit/1a6e4052cb5c45d00fb94911a66b3789bd3ddea1))
* **Core:** `DocxFormIssueKind.LockedControl` (value 10). ([#551](https://github.com/Ank-KhoaHo/DocToolkit/issues/551)) ([1a6e405](https://github.com/Ank-KhoaHo/DocToolkit/commit/1a6e4052cb5c45d00fb94911a66b3789bd3ddea1))
### Changed
* **Core:** `DocxForm.Fill` now writes a control locked only against deletion (`sdtLocked`), as Word does, and keeps the lock. Since 0.54.0 it refused all three lock kinds alike. ([#551](https://github.com/Ank-KhoaHo/DocToolkit/issues/551)) ([1a6e405](https://github.com/Ank-KhoaHo/DocToolkit/commit/1a6e4052cb5c45d00fb94911a66b3789bd3ddea1))
* **Core:** `DocxForm.Validate` reports a value aimed at a content-locked control as `DocxFormIssueKind.LockedControl`; it reported `Other` before. A consumer that switched on `Other` for locks needs the new case. ([#551](https://github.com/Ank-KhoaHo/DocToolkit/issues/551)) ([1a6e405](https://github.com/Ank-KhoaHo/DocToolkit/commit/1a6e4052cb5c45d00fb94911a66b3789bd3ddea1))