OfficeIMO - Office and document libraries for .NET

June 26, 2026 ยท View on GitHub

CI codecov license

Blog LinkedIn Discord

OfficeIMO is a family of COM-free .NET libraries for creating, reading, converting, and exporting Office and document formats. The packages are designed for services, desktop apps, build agents, and automation hosts where Microsoft Office automation is not available or not appropriate.

If OfficeIMO saves you time, please consider supporting the work through GitHub Sponsors or PayPal. Sponsorship helps keep the libraries maintained, tested, and MIT licensed.

PowerShell users should start with EvotecIT/PSWriteOffice, which is the PowerShell-facing project built around OfficeIMO.

Main packages

PackagePurpose
OfficeIMO.WordCreate, edit, inspect, and convert .docx documents.
OfficeIMO.ExcelCreate and modify .xlsx workbooks, open legacy .xls workbooks, worksheets, tables, ranges, styles, and reports.
OfficeIMO.PowerPointGenerate .pptx presentations programmatically.
OfficeIMO.VisioCreate, inspect, validate, and export .vsdx diagrams without Visio automation.
OfficeIMO.PdfDependency-free PDF creation, reading, inspection, page operations, and converter engine support.
OfficeIMO.RtfDependency-free RTF parser, syntax tree, fluent document model, and writer.
OfficeIMO.MarkdownTyped Markdown AST, builder API, reader, and HTML renderer.
OfficeIMO.ReaderUnified read-only extraction facade with modular adapters.

Converters and adapters

PackagePurpose
OfficeIMO.Word.HtmlWord to/from HTML conversion.
OfficeIMO.Word.MarkdownWord to/from Markdown conversion.
OfficeIMO.Word.PdfWord to PDF through OfficeIMO.Pdf.
OfficeIMO.Word.RtfWord to/from RTF through OfficeIMO.Rtf.
OfficeIMO.Excel.PdfExcel workbook to PDF through OfficeIMO.Pdf.
OfficeIMO.PowerPoint.PdfPowerPoint presentation to PDF through OfficeIMO.Pdf.
OfficeIMO.Markdown.HtmlHTML to Markdown document conversion.
OfficeIMO.Markdown.PdfMarkdown to PDF through OfficeIMO.Pdf.
OfficeIMO.Html.PdfHTML to PDF and PDF to HTML through OfficeIMO document models.
OfficeIMO.HtmlShared HTML ingestion plus HTML to/from RTF through OfficeIMO.Rtf.
OfficeIMO.Rtf.PdfRTF to/from PDF through the dependency-free OfficeIMO.Pdf engine.

Markdown, markup, and rendering

PackagePurpose
OfficeIMO.MarkupMarkdown-inspired semantic authoring model for OfficeIMO documents.
OfficeIMO.Markup.WordRender markup documents to Word.
OfficeIMO.Markup.ExcelRender markup documents to Excel workbooks.
OfficeIMO.Markup.PowerPointRender markup documents to PowerPoint presentations.
OfficeIMO.Markup.CliCLI parser, validator, preview, and code-emission tooling.
OfficeIMO.MarkdownRendererBrowser/WebView-friendly Markdown rendering shell.
OfficeIMO.MarkdownRenderer.WpfWPF/WebView2 Markdown host control.
OfficeIMO.MarkdownRenderer.IntelligenceXIntelligenceX renderer feature pack.
OfficeIMO.MarkdownRenderer.SamplePluginSample third-party-style renderer plug-in package.

Reader family

PackagePurpose
OfficeIMO.ReaderCommon extraction model and folder/stream helpers.
OfficeIMO.Reader.CsvCSV/TSV reader adapter.
OfficeIMO.Reader.EpubEPUB reader adapter.
OfficeIMO.Reader.HtmlHTML reader adapter.
OfficeIMO.Reader.JsonJSON reader adapter.
OfficeIMO.Reader.PdfPDF reader adapter.
OfficeIMO.Reader.RtfRTF reader adapter.
OfficeIMO.Reader.TextStructured text compatibility adapter.
OfficeIMO.Reader.VisioVisio inspection snapshot adapter.
OfficeIMO.Reader.XmlXML reader adapter.
OfficeIMO.Reader.YamlYAML reader adapter.
OfficeIMO.Reader.ZipZIP traversal reader adapter.

Google Workspace and primitives

PackagePurpose
OfficeIMO.GoogleWorkspaceShared Google Workspace credentials, sessions, retry, Drive location, and translation reporting.
OfficeIMO.Word.GoogleDocsWord to Google Docs planning and export scaffolding.
OfficeIMO.Excel.GoogleSheetsExcel to Google Sheets planning and export scaffolding.
OfficeIMO.CSVFluent CSV document model.
OfficeIMO.DrawingShared color, image, font, and drawing primitives.
OfficeIMO.ZipSafe ZIP traversal primitives.
OfficeIMO.EpubEPUB extraction primitives.

Install

Install only the packages you need:

dotnet add package OfficeIMO.Word
dotnet add package OfficeIMO.Excel
dotnet add package OfficeIMO.PowerPoint
dotnet add package OfficeIMO.Pdf

Converter packages are intentionally separate so applications can opt into the extra dependency surface only when needed:

dotnet add package OfficeIMO.Word.Pdf
dotnet add package OfficeIMO.Excel.Pdf
dotnet add package OfficeIMO.Markdown.Pdf

Quick example

using OfficeIMO.Word;

using var document = WordDocument.Create("report.docx");
document.AddParagraph("OfficeIMO").SetBold();
document.AddParagraph("Created without Microsoft Office automation.");
document.Save();

Common workflows

Create an Excel report

using OfficeIMO.Excel;

using var workbook = ExcelDocument.Create("sales.xlsx");
var sheet = workbook.AddWorkSheet("Sales");

sheet.CellValue(1, 1, "Product");
sheet.CellValue(1, 2, "Revenue");
sheet.CellValue(2, 1, "Alpha");
sheet.CellValue(2, 2, 120);
sheet.CellValue(3, 1, "Beta");
sheet.CellValue(3, 2, 92);
sheet.AddTable("A1:B3", hasHeader: true, name: "SalesTable", style: TableStyle.TableStyleMedium2);
sheet.AutoFitColumns();

workbook.Save();

Parse CSV into typed objects

using OfficeIMO.CSV;

List<Person> people = CsvDocument.Load("people.csv")
    .EnsureSchema(schema => schema
        .Column("Id").AsInt32().Required()
        .Column("Name").AsString().Required())
    .ValidateOrThrow()
    .Map<Person>(map => map
        .FromColumn<int>("Id", (person, value) => { person.Id = value; return person; })
        .FromColumn<string>("Name", (person, value) => { person.Name = value; return person; }))
    .ToList();

public sealed class Person {
    public int Id { get; set; }
    public string Name { get; set; } = "";
}

Export Word to PDF

using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;

using var document = WordDocument.Load("proposal.docx");
document.SaveAsPdf("proposal.pdf");

Read, split, merge, and stamp PDFs

using OfficeIMO.Pdf;

using var source = PdfDocument.Open("packet.pdf");

string firstPageText = source.Read.Text("1");
source.Pages.Extract("1-3").Save("packet-summary.pdf");

PdfDocument.Open("packet.pdf")
    .MergeWith("appendix.pdf")
    .Pages.Delete("2")
    .Stamp.Text("Reviewed")
    .Save("packet-final.pdf");

Convert PDF tables back into editable Office files

using OfficeIMO.Excel.Pdf;
using OfficeIMO.Word.Pdf;

PdfExcelTableConverterExtensions.SavePdfTablesAsExcel(
    "statement.pdf",
    "statement-tables.xlsx");

PdfWordTableConverterExtensions.SavePdfTablesAsWord(
    "statement.pdf",
    "statement-tables.docx");

Convert Markdown and HTML to PDF

using OfficeIMO.Markdown.Pdf;

"# Status\n\nGenerated by OfficeIMO.".SaveAsPdf("status.pdf");
using OfficeIMO.Html.Pdf;

"<h1>Status</h1><p>Generated by OfficeIMO.</p>"
    .SaveAsPdf("status-html.pdf", HtmlPdfSaveOptions.CreateDocumentProfile());

Extract content for indexing or RAG

using OfficeIMO.Reader;
using OfficeIMO.Reader.Pdf;
using OfficeIMO.Reader.Zip;

DocumentReaderPdfRegistrationExtensions.RegisterPdfHandler();
DocumentReaderZipRegistrationExtensions.RegisterZipHandler();

var chunks = DocumentReader.ReadFolder("KnowledgeBase",
    new ReaderFolderOptions {
        Recurse = true,
        MaxFiles = 500,
        DeterministicOrder = true
    },
    new ReaderOptions {
        MaxChars = 8_000,
        ComputeHashes = true
    }).ToList();

Create a Visio diagram

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

VisioDocument.Create("network.vsdx")
    .NetworkTopologyDiagram("Branch topology", topology => topology
        .Title()
        .Root("internet", "Internet", VisioNetworkNodeKind.Internet)
        .Firewall("firewall", "Firewall")
        .Switch("core", "Core Switch")
        .Server("app", "App Server")
        .Ethernet("internet", "firewall", "WAN")
        .Trunk("firewall", "core")
        .Trunk("core", "app"))
    .Save();

Target frameworks

Most shipping libraries target netstandard2.0, net8.0, and net10.0. Some packages also include net472 or Windows-specific targets where the surface requires it. Check the package README or project file for exact targets.

Deeper docs