Architectural Standard: 100% Pure C# BCL, Zero External Dependencies (No EPPlus, ClosedXML, or DevExpress), Multi-Targeting across
.NET 8.0,.NET Framework 4.6.2, and.NET Standard 2.0.
ZeroDocuments is an ultra-fast, zero-dependency spreadsheet and document processing engine engineered for enterprise applications (MDS ERP, WinForms, Web APIs, and microservices). It reads and writes modern Microsoft Excel files (.xlsx) and RFC 4180 CSV streams in pure C# using native BCL primitives (System.IO.Compression + System.Xml), eliminating the need for bulky third-party libraries (EPPlus, ClosedXML, NPOI) or expensive proprietary packages (DevExpress).
| Feature | Legacy Libraries (EPPlus, ClosedXML) | DevExpress Spreadsheet | ZeroDocuments |
|---|---|---|---|
| Dependencies | 5 β 15 transitive packages | Heavy proprietary DLLs (~40MB+) | 0 External Dependencies (BCL only) |
| License | Commercial / PolyForm / AGPL | Commercial (Per-Developer License) | MIT License (Free & Open Source) |
| Publish Size | +15MB β 30MB | +40MB β 80MB | < 100 KB |
| Memory Footprint | Heavy DOM Tree (>200MB on 100k rows) | Heavy UI/DOM model | Streaming XmlReader (< 15MB RAM) |
| Security | Vulnerable to CSV Injection if unescaped | Depends on implementation | CWE-1236 Formula Guard Built-in |
| .NET 4.6.2 Compatibility | Prone to System.IO.Compression binding issues |
Complex assembly deployment | Native Auto-Resolver built-in |
ZeroDocuments.Core
βββ Excel/
β βββ ZeroExcel.cs # Fluent multi-sheet workbook factory
β βββ ExcelWorkbookBuilder.cs # Multi-sheet OpenXML package generator with styling
β βββ ExcelReader.cs # Low-memory streaming XmlReader & POCO mapper
β βββ ExcelWriter.cs # High-speed single-sheet OpenXML exporter
β βββ Models/
β βββ ExcelCellAddress.cs # Coordinate calculations (e.g., "D24" -> Col 4, Row 24)
β βββ ExcelRow.cs # Column-indexed lightweight row model
β βββ ExcelCell.cs # Typed cell value container
βββ Csv/
β βββ CsvReader.cs # RFC 4180 streaming CSV parser with delimiter flexibility
β βββ CsvWriter.cs # Fast DataTable & typed collection CSV generator with CWE-1236 guard
βββ Common/
βββ PropertyAccessorCache.cs # Compiled Expression Trees for 30x-50x faster POCO mapping
βββ RuntimeAssemblyResolver.cs # Self-healing assembly binder for .NET Framework runtimes
- Forward-Only Streaming (
StreamRows): Processes 1,000,000+ rows with < 15MB RAM without building heavy DOM trees. - Compiled POCO Mapping (
Read<T>): Maps worksheets directly into strongly-typed DTOs via compiled Expression Trees without reflection lag. - Header-Bounded Range Parsing: Read data bounded by a specific header range (e.g.
D24:T24), ideal for complex enterprise invoice and production templates.
- Multi-Sheet Support: Add multiple sheets with custom names, data sources (DataTables, POCOs, 2D grids), and header styling (Bold, border layout).
- Formula Injection Mitigation (CWE-1236): Automatically neutralizes malicious formula payloads (
=,+,-,@) to protect downstream users. - Direct Memory & File Export: Save to file, stream, or byte array (
ToArray()).
- Eliminates reflection overhead when serializing or deserializing collections of objects, achieving 30xβ50x speedups over
PropertyInfo.GetValue.
- Flexible Delimiters: Support for comma (
,), semicolon (;), tab (\t), and custom delimiters. - CWE-1236 Guard: Prevents CSV injection attacks by automatically prefixing dangerous trigger characters with single quotes.
- Automatically resolves
.NET Framework 4.6.2assembly binding redirects forSystem.IO.Compression.
- Direct Image Embedding: Embed PNG, JPEG, and JPG images into any worksheet with precise cell anchors, pixel dimensions, and EMU coordinate scaling.
- Embedded Media Extraction: Extract all embedded images from existing
.xlsxpackages viaExcelReader.ExtractImages.
- Cell Highlight Rules: Highlight cells matching conditions (GreaterThan, LessThan, Equal, Between) with custom ARGB background fills and bold fonts via OpenXML DXF styles.
- Color Scales & Data Bars: Generate 2-color / 3-color gradient heatmaps and horizontal data bars.
- AutoFilter: One-line automatic header filtering (
SetAutoFilter).
using ZeroDocuments.Excel;
// Read starting from header D24:T24 down to a maximum of 5,000 rows
DataTable table = ExcelReader.ReadByHeaderRange("PurchaseOrder.xlsx", "D24:T24", maxRows: 5000);
foreach (DataRow row in table.Rows)
{
string itemCode = row["Item Code"]?.ToString() ?? "";
decimal quantity = Convert.ToDecimal(row["Quantity"]);
Console.WriteLine($"Item: {itemCode} | Qty: {quantity}");
}using ZeroDocuments.Excel;
// Stream rows without loading the entire document into memory
var rows = ExcelReader.ReadRows("Inventory.xlsx", "A1:Z500");
foreach (var row in rows)
{
string? barcode = row["B"]; // Read cell by column letter
string? name = row["C"];
Console.WriteLine($"{barcode}: {name}");
}using ZeroDocuments.Excel;
using var workbook = ZeroExcel.Create();
workbook.AddSheet("Summary", summaryTable);
workbook.AddSheet("Products", productList);
workbook.AddSheet("AuditLogs", logRows, headers: new[] { "Event", "Date", "Status" });
// Save directly to file or byte array
workbook.Save("EnterpriseReport.xlsx");
byte[] rawBytes = workbook.ToArray();using ZeroDocuments.Excel;
// Automatically map Excel columns into ProductDto properties via compiled Expression Trees
List<ProductDto> products = ExcelReader.Read<ProductDto>("Products.xlsx", "A1:E500", "ProductCatalog");
foreach (var p in products)
{
Console.WriteLine($"ID: {p.Id}, SKU: {p.Sku}, Price: {p.Price:C}");
}using ZeroDocuments.Csv;
// Read CSV to DataTable
DataTable csvData = CsvReader.ReadToDataTable("telemetry.csv", delimiter: ',');
// Write DataTable to CSV (with automatic formula injection mitigation)
CsvWriter.WriteToFile("output.csv", csvData, delimiter: ';', includeHeaders: true);using ZeroDocuments.Excel;
byte[] logoBytes = File.ReadAllBytes("company_logo.png");
using var workbook = ZeroExcel.Create();
workbook.AddSheet("Invoice", invoiceRows, headers: new[] { "Item", "Quantity", "Price" })
.AddImage("Invoice", logoBytes, format: "png", column: 5, row: 1, widthPx: 140, heightPx: 70, name: "CompanyLogo")
.Save("InvoiceWithLogo.xlsx");
// Extract embedded media from existing workbooks
List<ExcelEmbeddedImage> images = ExcelReader.ExtractImages("InvoiceWithLogo.xlsx");using ZeroDocuments.Excel;
using ZeroDocuments.Excel.Models;
using var workbook = ZeroExcel.Create();
workbook.AddSheet("KPI", salesData, headers: new[] { "Region", "Sales", "Target" })
.SetAutoFilter("KPI") // Enable header filter dropdowns
.AddHighlightRule("KPI", "B2:B100", CellRuleOperator.LessThan, "5000",
fillColorHex: "FFC7CE", fontColorHex: "9C0006", bold: true)
.AddColorScale("KPI", "C2:C100", minColorHex: "F8696B", maxColorHex: "63BE7B")
.Save("KpiDashboard.xlsx");| Framework | Target Support | Highlights |
|---|---|---|
| .NET 8.0+ | Native (net8.0) |
High-throughput ZIP and memory optimization |
| .NET Framework | Legacy WinForms / WPF (net462) |
Includes automatic assembly resolver for compression |
| .NET Standard | Universal Cross-Platform (netstandard2.0) |
Universal compatibility for shared libraries |
MIT License Β© 2026 Phong VΓ΅ (kzxl). Part of the ZeroPlatform sovereign ecosystem.