OpenDocx.NET
1.0.1
See the version list below for details.
dotnet add package OpenDocx.NET --version 1.0.1
NuGet\Install-Package OpenDocx.NET -Version 1.0.1
<PackageReference Include="OpenDocx.NET" Version="1.0.1" />
<PackageVersion Include="OpenDocx.NET" Version="1.0.1" />
<PackageReference Include="OpenDocx.NET" />
paket add OpenDocx.NET --version 1.0.1
#r "nuget: OpenDocx.NET, 1.0.1"
#:package OpenDocx.NET@1.0.1
#addin nuget:?package=OpenDocx.NET&version=1.0.1
#tool nuget:?package=OpenDocx.NET&version=1.0.1
OpenDocx.NET
A .NET library for document processing and templating with OpenXML. This package provides a low-level toolkit for transforming and assembling Word documents. It is layered on top of Eric White's excellent Open XML Power Tools, extending it with additional capabilities:
- Flexible field syntax - Specify your own field delimiters and syntax for document templates
- Basic field types - Supports content fields, nestable conditional logic (
if/elseif/else/endif), and nestable lists (list/endlist) without imposing restrictions on field expressions - Template transformation - Convert DOCX files with your custom syntax into Open XML Power Tools-compatible templates by separating them into:
- Logic tree (JSON) - Encapsulates the data structure and logical rules of the template
- Optimized DOCX file - Ready for use with Open XML Power Tools' DocumentAssembler
- Template optimization - Utilities for optimizing template logic
- Multi-template assembly - Handles assembling and composing complex documents from multiple template sources
What's NOT Included
OpenDocx.NET is intentionally data-source agnostic. It doesn't know or care where your data is stored or how it's structured—it only cares about the data structure that your template requires.
This package does NOT include:
- Data transformation tools for converting your source data into template-compatible formats
- Database connectors or data access layers
- Business logic for data processing or validation
What you need to provide: OpenDocx.NET generates a logic tree (a simple JSON structure) that describes exactly what data structure your template expects. It's your responsibility to transform your source data to match this structure and provide it as XML or JSON. Once you do that, OpenDocx.NET handles the rest—-assembling and composing even the most complex documents.
Features
- Document assembly and templating
- Field extraction and processing
- Template transformation
- Logic tree generation
- Content control processing
- Document validation
Installation
Install the package via NuGet Package Manager:
Install-Package OpenDocx
Or via .NET CLI:
dotnet add package OpenDocx
Usage
The OpenDocx library provides various classes for working with Word documents:
FieldExtractor- Extract fields from DOCX files and analyze template structureTemplater- Process templates and transform field syntaxAssembler- Perform document assembly operations using logic trees and dataComposer- Compose complex documents from multiple template sourcesValidator- Validate document structure and template integrity
Requirements
- .NET 6.0 or later
- DocumentFormat.OpenXml 2.19.0 (compatibility with later versions not yet tested)
License
This project is licensed under the Mozilla Public License 2.0.
Contributing
This package is part of the OpenDocx.NET project. Please refer to the main repository for contribution guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 was computed. 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 was computed. 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. |
-
net6.0
- DocumentFormat.OpenXml (>= 2.19.0)
- Microsoft.CodeAnalysis (>= 2.10.0)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.DependencyModel (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- OpenXmlPowerTools-Net6 (>= 4.6.24)
- System.IO.Packaging (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 1.0.1 - fix handling of Word field codes, package metadata updates, documentation improvements.