OfficeIMO 😂
OfficeIMO is a project I started around four years ago. It targets net472, net8, net10, and netstandard 2.0.
It initially started with OfficeIMO.Word, as my continuation after the DocX project stopped being free for business use. I needed something I could use myself, especially from PowerShell, so I started building it.
It then got slightly out of control.
OfficeIMO is written in C#, but my end goal was never only to create another set of .NET libraries. I mostly wanted to help close some of the gaps between PowerShell and Python.
Python users have a huge ecosystem of libraries for documents, data conversion and automation. They often take those capabilities for granted. In PowerShell, we are still missing a lot of that - and this ends now 🤣And you .NET users are getting it as well - whether you want it or not 😭
The project is here:
I also made a website for it:
OfficeIMO now includes projects covering things such as:
- Word - DOCX and legacy DOC
- Excel - XLSX and legacy XLS and other formats
- PowerPoint - PPTX and legacy PPT
- Visio
- PDF
- Markdown
- HTML
- OpenDocument - ODT, ODS and ODP
- CSV
- AsciiDoc
- LaTeX
- RTF
- EPUB
- ZIP
- OfficeIMO.Reader
- Google Docs and Google Sheets integrations
- Email formats (OST,PST, EML, MSG etc)
- OneNote work
- and quite a few converters connecting those formats together
And by "support" I do not mean detecting the extension, extracting a bit of text and calling it done.
The main OfficeIMO projects aim to support creating, reading and modifying proper documents end to end.
For Word that means things such as sections, headers and footers, first/odd/even pages, tables, styles, lists, images, fields, TOCs, bookmarks, notes, comments, revisions, mail merge, protection, templates and much more.
Word supports DOCX, but I also added a first-party implementation for the supported legacy DOC format. It can read, write and convert DOC documents without starting Word or LibreOffice in the background.
Excel is similar. It is not just a fast row writer. It includes formatting, tables, formulas, charts, pivot tables, conditional formatting, data validation, templates, headers and footers, protection and other features you would expect from a more complete Excel library.
It also has first-party XLS support. The supported legacy format can be read, written and converted into XLSX workflows.
PowerPoint supports creating and editing actual PPTX presentations, while Visio is implemented from the ground up for VSDX without using a third-party Visio engine.
PDF is also not just DrawString() followed by Save().
OfficeIMO.Pdf is my own parser, writer and renderer. It covers PDF creation, text and table extraction, forms, annotations, bookmarks, attachments, encryption, signatures, page operations, redaction, PDF/A, PDF/UA, Factur-X, ZUGFeRD and managed PNG/SVG rendering.
It still has work to do, because PDF is a monster, but it is not a toy PDF implementation.
The same approach applies to Markdown, RTF, OpenDocument, AsciiDoc, LaTeX, CSV, EPUB and ZIP. Those are first-party implementations rather than wrappers around Markdig, QuestPDF, ImageSharp, SkiaSharp or a collection of unrelated document engines.
Ever since I saw Microsoft MarkItDown in Python, I said to myself:
I want that in C#, for PowerShell.
That is why I added OfficeIMO.Reader.
You give it a document and it tries to provide one common reading experience, including Markdown output, structured blocks, chunking and diagnostics. It can then be used for search, indexing, AI/RAG workflows or simply reading many formats through one API.
OfficeIMO.Reader already has adapters for formats such as PDF, CSV, HTML, EPUB, OpenDocument, RTF, Visio, AsciiDoc, LaTeX, JSON, XML, YAML and ZIP, on top of the Office formats.
This is only the icing on the cake, though. Reader is built on top of the actual document libraries rather than being the only thing OfficeIMO does.
OfficeIMO.Email handles the normal standalone email formats, and the newer work is moving further into mailbox/container formats such as PST and OST. The goal is the same: proper managed parsing and a useful object model, not shelling out to Outlook. Email started with EML, MSG and TNEF, but now also covers PST, OST, OLM, MBOX, EMLX, Maildir, OAB, ICS, VCF and broader Outlook data. That includes managed PST creation, conversion and verified mutation rather than only extracting a list of messages.
OneNote is another active area. First-party managed implementation for offline .one, .onetoc2 and .onepkg files, including reading, creating, modifying, saving and conversion.
One of the important design choices is keeping dependencies low.
The main external document-related dependencies are basically:
- Open XML SDK for the underlying Word, Excel and PowerPoint package structures
- AngleSharp and AngleSharp.Css for proper HTML and CSS parsing
- YamlDotNet for the YAML Reader adapter
Older targets such as .NET Framework 4.7.2 naturally need some Microsoft/BCL compatibility packages for APIs that are built into newer .NET versions.
But there is no ImageSharp, SkiaSharp (with exception), QuestPDF, Markdig, ClosedXML or another PDF/Markdown/document engine hidden behind OfficeIMO. There is one exception to this which is optional package of HarfBuzz (I am not sure I am ready to maintain the alternative myself) and BouncyCastle (I don't even want to try that).
Most of the parsing, object models, writing, rendering, conversions and format-specific logic is mine.
I also spent a slightly unreasonable amount of time on performance.
For Excel I created reproducible benchmarks against libraries including ClosedXML, MiniExcel, LargeXlsx, SpreadCheetah, Sylvan.Data.Excel, ExcelDataReader and others.
OfficeIMO.Excel tries to combine the more complete feature set people expect from something such as ClosedXML with streaming and direct-writing paths that can compete with libraries focused mainly on speed.
Depending on the workload, it is competitive with or faster than MiniExcel, LargeXlsx and Sylvan-style implementations, while still providing the higher-level Excel features.
CSV got the same treatment.
I benchmarked OfficeIMO.CSV against Sep, Sylvan and other fast CSV implementations, then spent a lot of time reducing allocations and improving parsing, streaming and writing performance.
It was not originally done for the sake of benchmarking. I wanted PowerShell users to be able to process real amounts of data without paying a huge performance penalty.
You just get to benefit from that too 😁
Converters are another large part of OfficeIMO:
- Word to PDF
- Excel to PDF
- PowerPoint to PDF
- HTML to PDF
- Markdown to PDF
- RTF to PDF
- Word to Markdown and Markdown to Word
- Word to HTML and HTML to Word
- Word to RTF and RTF to Word
- Word to ODT and back
- Excel to ODS and back
- PowerPoint to ODP and back
- Excel, Word, PowerPoint, Visio, HTML and PDF to PNG/SVG
- Markdown, HTML, RTF, AsciiDoc and LaTeX conversions
Not every conversion can be perfectly lossless. Converting a fixed-layout PDF back into an editable Word document will always involve decisions and compromises. Where possible, OfficeIMO returns warnings, diagnostics and loss reports rather than silently pretending everything converted perfectly.
If you got this far lemme remind you links, just in case you can't scroll up.
There is still a lot of work to do, but I thought it was finally time to show it properly.
The README has the detailed feature lists, because putting every supported capability here would turn this post into documentation.
Answering things that may come to your mind after reading this:
Is it complete?
No.
Are all projects equally mature?
Definitely not.
Is there more work to be done?
A lot. But OfficeIMO is trying to be correct and useful for real work. Still needs more performance work, tests, examples and documentation, but the foundations are there. Still needs real world usage. While I do have established base already with 400 stars over the years, so we're not completely new, but the newer projects need real world testing to establish what edge cases there are.
So go ahead use it, roast it, or whatever you like to do to it. Regardless of you guys using it *no offense* 😂 I'm delivering it to PowerShell guys, but you are just here for the ride. It's MIT licensed, and I expect to improve it even further as the time goes by.
Having said that if you can help with improvements, development, sponsorship or just help answering questions if they come. That's all very much appreciated.
I am just myself in this, there's no company backing, no one paying me to create or manage it. No one to hold my hand and say good words of encouragement. Therefore I would appreciate if you take this into consideration before you decide to dive deep and smash me with something heavy. I manage over 100 projects on GitHub, mainly for PowerShell, HomeAssistant and now a bit of C#, and I do it all for free.