This content is for v4.x (Alpha). Switch to the Stable version.
Getting Started
Technical Details
This release marks a significant evolution for the OpenXML-office project. The upcoming version, V4, will be a complete rewrite of this package. It aims to maintain previous release structures as much as possible, with a strong focus on minimizing migration efforts for adopters.
Inspiration
This project has been in the works for nearly a year, driven by a desire to explore the OpenXML standards for office documents. Initially developed as a C# project using the OpenXML-SDK as a baseline, I have now gathered sufficient knowledge to transition into a cross-platform, multi-language supported package. This effort is a way to give back to the community that has been instrumental in my professional and personal growth.
Architecture
The core system is written in Rust, ensuring optimal performance and memory usage. This system is then exposed as a "C" extern FFI, facilitating interaction with other languages. Wrappers for each supported language have been created, and the package is published in the respective package managers. For TypeScript/Javascript, wasm is utilized to create a Node.js package, preserving performance advantages. The data transmission is handled using FlatBuffer, following a central schema that ensures consistent patterns across all supported languages and facilitates code organization and documentation maintenance.
Support Scope
This package supports .xlsx, .pptx, and .docx formats starting from Office 2007. Features are organized into respective modules, namespaces, and directories to provide clarity on the minimum supported version for each feature. The package is designed to be compatible with all applications that open standard OpenXML documents, including online solutions.
Package Version Details
The official release Crate package for openxml-office on Crates.io:
| Package | Maintenance | Current Stable Release | Current Alpha Release |
|---|---|---|---|
| draviavemal-openxml_office | Active |
The official release NuGet packages for openxml-office on NuGet.org:
Note: draviavemal.openxml-office contains all old module included in same package
| Package | Maintenance | Current Stable Release | Current Alpha Release |
|---|---|---|---|
| draviavemal.openxml-office | Active | ||
| OpenXMLOffice.Presentation | InActive | ||
| OpenXMLOffice.Spreadsheet | InActive | ||
| OpenXMLOffice.Document | NA |
TODO
Phase 2
Phase 2
Phase 2
The library is available on crates.io. You can install it using the following command
#Using Package Managercargo add draviavemal-openxml_office# Cargo.toml add below detailsdraviavemal-openxml_office = "4.0.0-alpha.5"The library is available on NuGet. You can install it using the following command
#Using Package ManagerInstall-Package draviavemal.openxml-office#Using .NET CLIdotnet add package draviavemal.openxml-office# For Pre Releasedotnet add package draviavemal.openxml-office --prereleasePhase 2
Phase 2
Phase 2
Once Installed the package should be direct use available like below example. More samples can be seen in test project's of the repo or check other parts of the documents
Excel
// Create new Excel File in memorylet mut file = crate::spreadsheet_2007::Excel::new( None, crate::spreadsheet_2007::ExcelPropertiesModel::default(), ).context("Create New File Failed")?;
// Save the created file in destination pathfile.save_as("result.xlsx").context("Save File Failed")?;using OpenXMLOffice.Spreadsheet_2007;
public static main(){ Excel excel = new(); excel.AddSheet("Sheet1"); excel.SaveAs(string.Format("../../test-{0}.xlsx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")));}Phase 2
Phase 2
Phase 2
Power Point
// Create new Presentation File in memorylet file = crate::presentation_2007::PowerPoint::new( None, crate::presentation_2007::PowerPointPropertiesModel::default(), ).context("Create New File Failed");
// Save the created file in destination pathfile.save_as(&get_save_file(None)).context("Failed to save Empty Power Point");using OpenXMLOffice.Presentation_2007;
public static main(){ PowerPoint powerPoint = new(); powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK); powerPoint.SaveAs(string.Format("../../test-{0}.pptx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")));}Phase 2
Phase 2
Phase 2
Word / Document
// Create new Word File in memorylet file = crate::document_2007::Word::new( None, crate::document_2007::WordPropertiesModel::default() ).context("Create New File Failed");
// Save the created file in destination pathfile.save_as(&get_save_file(None)).context("Save Result Failed");using OpenXMLOffice.Document_2007;
public static main(){ Word word = new(); word.SaveAs(string.Format("../../test-{0}.docx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")));}Phase 2
Phase 2
Phase 2