$ show xceedsoftware/DocX
DocX is a .NET library for creating, editing, and manipulating Word 2007/2013/2016 .docx files without requiring Microsoft Office. It provides a comprehensive API for document generation, including paragraphs, tables, charts, images, hyperlinks, headers/footers, bookmarks, footnotes/endnotes, mail merge, and password protection. The library operates by manipulating Open XML package parts using System.IO.Packaging and LINQ to XML, with a cross-platform drawing abstraction layer (SkiaSharp on .NET5, System.Drawing on .NET Framework). It is the free community edition of Xceed Words for .NET, with many advanced features (PDF conversion, SVG support, digital signatures) stubbed out in the examples and requiring a commercial license. The codebase is well-structured but shows signs of technical drift: it targets .NET Framework 4.0 and .NET 5.0 (both out of support), uses deprecated APIs, and contains large monolithic files (e.g., Document.cs ~3880 lines). Despite these issues, the library is actively maintained (last commit June 2026) and widely used, with a rich set of examples demonstrating real-world usage.
The LLM identified 3 files worth highlighting for reuse:
Provides a cross-platform Color abstraction that maps to System.Drawing.Color on .NET Framework and SkiaSharp's SKColor on .NET5. This pattern allows the library to use a unified color API while delegating to platform-specific implementations. It is self-contained and could be extracted for any .NET project needing cross-platform color handling.
Contains an internal Encryption class that implements the Office Document Cryptography algorithm (SHA-1, SHA-256, SHA-384, SHA-512) for password-protecting .docx files. This is a self-contained implementation of a specific cryptographic standard, isolated from the rest of the document model. It could be reused in other projects that need to create password-protected Office documents.
A thread-safe stream wrapper that prevents deadlocks when writing to OpenXML package parts. It uses a lock to synchronize access to the underlying stream. This is a simple but effective pattern for safely sharing streams in multi-threaded document processing scenarios. It is self-contained and could be extracted for any project dealing with concurrent stream access.