DocWright 1.1.4

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

DocWright

NuGet Downloads Documentation .NET License: MIT

Word documents in .NET, rendered the way Word renders them. Convert DOCX and DOC to PDF and images, edit and generate documents, run mail merges, compare versions and run SSRS reports, all in managed code, with no Microsoft Word, no Office interop and no native binaries.

๐Ÿ“– Documentation ยท Get started ยท Tutorials ยท Guides ยท API reference

Features

  • Convert to PDF that matches Word's own export. Layout is measured against Word, document by document, with PDF/A-2b archival output and tagged, accessible PDF.
  • Render page images: PNG or JPEG at any resolution or size, for Word documents and for existing PDF files.
  • Edit documents: find and replace across formatting runs, fill {{placeholder}} templates, bookmarks and ranges, fields, forms and content controls, merge and split documents.
  • Assemble PDFs: merge, split, extract, delete and reorder pages of existing PDFs, without re-rendering them.
  • Open protected files: password-protected DOCX and DOC, with AES-256 encryption on save.
  • Handle untrusted input safely: resource limits against ZIP bombs, oversized images, deep nesting and slow documents. Nothing is fetched and nothing is executed.
  • Get the same bytes every time: identical input and options produce byte-identical output on every framework and platform. One converter is safe to share across threads.
  • Add capabilities as you need them: mail merge, fluent document composition, document comparison, digital signatures, complex-script shaping and SSRS reporting ship as separate packages.
Format Read Write
DOCX โœ… โœ…
DOC (Word 97โ€“2003) โœ…
PDF pages to images โœ… (incl. PDF/A-2b)
PNG, JPEG โœ…
HTML, RTF, Markdown, plain text โœ… โœ…
ODT, EPUB 3, SSRS RDL/RDLC โœ…

Install

dotnet add package DocWright

That is all you need for everything on this page โ€” the format readers, writers, layout engine, font engine and both renderers come with it automatically.

Convert a document to PDF

using DocWright;

var converter = new DocWrightConverter();

using FileStream input  = File.OpenRead("report.docx");
using FileStream output = File.Create("report.pdf");

ConversionResult result = converter.Convert(input, output);
Console.WriteLine($"{result.PageCount} pages");

Convert always renders to PDF. The input format is detected automatically; override that with ConvertOptions.SourceFormat when you are reading from a stream with no file name. Your first conversion โ†’

Save to another document format

Converting renders to PDF; saving round-trips an editable format, chosen by extension:

using DocWright;

var converter = new DocWrightConverter();
using var document = converter.Load(File.OpenRead("report.docx"));

using FileStream html = File.Create("report.html");
converter.Save(document, html, ".html");

Writers ship for .docx, .html, .md, .rtf, .txt, .odt, .epub, .rdl and .rdlc. Readers ship for .docx, .doc, .html, .md, .rtf and .txt. Formats โ†’

Convert a document to images

using DocWright;
using DocWright.Renderers.Imaging;

var converter = new DocWrightConverter();

var imageOptions = new ImageRenderOptions
{
    Dpi = 150,
    Format = ImageOutputFormat.Png,
    PageEncoded = (pageNumber, bytes) => File.WriteAllBytes($"page-{pageNumber}.png", bytes),
};

using FileStream input = File.OpenRead("report.docx");
converter.ConvertToImages(input, imageOptions);

Page images โ†’

Rasterize an existing PDF

using DocWright;
using DocWright.Renderers.Imaging;

var converter = new DocWrightConverter();

var imageOptions = new ImageRenderOptions
{
    Dpi = 150,
    Format = ImageOutputFormat.Png,
    PageEncoded = (pageNumber, bytes) => File.WriteAllBytes($"page-{pageNumber}.png", bytes),
};

using FileStream input = File.OpenRead("statement.pdf");
converter.ConvertPdfToImages(input, imageOptions);

ConvertToImages and ConvertPdfToImages have no output stream of their own, so ImageRenderOptions must set either PageEncoded or PageStreamFactory to receive the pages; they throw if neither is set.

PDF is not a document importer, so Load will not accept a PDF โ€” use ConvertPdfToImages for page images, or PdfPages / PdfPageAssembly (namespace DocWright.Formats.Pdf) to delete, extract, reorder, merge or split the pages of existing PDFs without rasterizing them. Assemble PDFs โ†’

Load, edit and save

using DocWright;
using DocWright.Dom;
using DocWright.Dom.Editing;

var converter = new DocWrightConverter();

using WordDocument document = converter.Load(File.OpenRead("template.docx"));

document.ReplacePlaceholders(new Dictionary<string, object?>
{
    ["CustomerName"] = "Contoso Ltd.",
    ["InvoiceTotal"] = 1499.00m,
});

using FileStream output = File.Create("filled.docx");
converter.Save(document, output);

Find and replace, {{placeholder}} template filling, bookmarks and ranges, merge and split, content controls, legacy form fields and custom-XML binding are all included here. Editing guides โ†’

Performance

DocWrightConverter caches its font engine per instance, and building one costs about a second. Create one converter and reuse it โ€” a converter per document turns a ten-second batch into a very long one. It is safe to use concurrently.

// Do this once, at startup, and share it.
static readonly DocWrightConverter Converter = new DocWrightConverter();

Optional add-ons

Everything above ships in this package. These are separate installs, added only when you want them:

Package Adds
DocWright.Composition Build a document from code with a fluent, declarative API
DocWright.MailMerge Merge fields, repeating regions, conditional records
DocWright.Compare Diff two documents into one with tracked changes
DocWright.Signatures Verify and create package and PDF signatures
DocWright.ComplexText HarfBuzz shaping for complex scripts beyond the built-in Arabic and Hebrew shaping (Indic and others)
DocWright.Reporting Run SSRS / Power BI paginated reports (.rdl) against your own data

DocWright.Cryptography and DocWright.Ole come with this package as dependencies: password-protected documents open through ConvertOptions.Password and save encrypted through SaveOptions.Encryption. Which packages do I need? โ†’

Documentation

Get started Install, first conversion, async, error handling
Tutorials A conversion web API, mail-merge invoices, JSON templates, reports in code, comparing contracts, assembling PDFs, SSRS reports
Guides Conversion options, fonts, PDF/A, editing, formats, reporting, security
API reference Every public type and member

Every code example in the documentation is compiled and run, and its output shown.

Requirements

.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0. Conversion is stateless and concurrency-safe, and honours cancellation and configurable resource limits.

Support and contact

Questions, feedback, support or licensing enquiries:

License

MIT. See LICENSE and THIRD-PARTY-NOTICES.md in the package.

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 (1)

Showing the top 1 NuGet packages that depend on DocWright:

Package Downloads
DocWright.Composition

Build a document from code with a fluent, declarative API for DocWright โ€” pages, headers and footers, columns, tables and text styling โ€” then render it to PDF, images or .docx through the same pipeline as a loaded document. A composition is ordinary C#, so loops, conditionals and your own data just work.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.4 72 9/28/2026
1.1.3 78 9/28/2026
1.1.2 144 9/3/2026
1.1.1 140 8/22/2026
1.1.0 213 8/22/2026

Guides, tutorials and API reference: https://docs.albahadly.com/docwright/