Skip to content
nissl-labPublic

About

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.

Topics

Resources

Security policy

Stars

6.2k stars

Watchers

276 watching

Forks

Latest commit

 

History

4,823 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet Nuget Ranking! Discord License EULA traffic Github contributors

Important

To ensure the long-term sustainability of this project, a monthly maintenance fee has been introduced. This fee is required to be paid by all organizations or users of any library from this project who generate revenue. You can pay the fee via GitHub Sponsors.

To enact this, an EULA on binary releases is added to the repo and nuget packages since 2.8.0 that requires payment of the maintenance fee.

For more information on who must pay the fee and other frequently asked questions, please see the Open Source Maintenance Fee organisation page.

What's NPOI

This project is the .NET version of Apache POI project. With NPOI, you can read/write Office 2003/2007 files very easily.

Documentation

NPOI Official Tutorials

Getting Started with NPOI

How NPOI library succeeds

How to use NPOI on Linux

Useful Packages based on NPOI

Sponsors

Thank you for all the sponsors. Here is the sponsors list

Advantage of NPOI

a. It's totally free to startups, freelancers, and hobbyists (whose annual revenue is less than $10,000 USD)

b. Cover most features of Excel (cell style, data format, formula and so on)

c. Supported formats: xls, xlsx, docx.

d. Designed to be interface-oriented (take a look at NPOI.SS namespace)

e. Support not only export but also import

f. Real successful cases all over the world

g. Works on both Windows and Linux

PPTX foundation (XSLF)

The initial NPOI.XSLF.UserModel API supports creating an empty transitional .pptx presentation, adding blank slides, and saving and reopening the package:

using NPOI.XSLF.UserModel;
using System.IO;

using var presentation = new XMLSlideShow();
presentation.CreateSlide();
presentation.CreateSlide();
using var output = File.Create("blank-slides.pptx");
presentation.Write(output);

Use new XMLSlideShow(inputStream) or new XMLSlideShow(opcPackage) to open an existing presentation, and GetSlides() to access slides in presentation order. Closing the presentation closes its underlying OPC package. As with the other OOXML APIs, save to a different file when opening a package from a file path.

The foundation follows the existing OOXML layering: partial PresentationML data models live in OpenXmlFormats/Presentation, while XMLSlideShow, XSLFSlide, XSLFRelation, and XSLFFactory live in ooxml/XSLF/UserModel. Packaging uses the existing OPC implementation. Slides, masters, and layouts share XSLFSheet. GetSlideMasters() and GetSlideLayouts() follow their XML reference-list order. XSLFTheme exposes read-only theme metadata using the existing DrawingML model. Unchanged master, layout, and theme parts retain their original bytes; unmodeled content remains intact when supported sheet models are saved. Opaque extension children retain their order relative to modeled sheet content, including extensions preceding common slide data in masters and layouts.

Use a layout from the same presentation to create a slide explicitly:

var master = presentation.GetSlideMasters()[0];
var layout = master.GetLayout("Blank");
if (layout == null)
    throw new InvalidOperationException("This master has no layout named Blank.");
var slide = presentation.CreateSlide(layout);
var theme = slide.GetTheme(); // May be null when the master has no theme.

Layouts expose Name and the PresentationML Type string. Slides expose GetSlideLayout(), GetSlideMaster(), and GetTheme(). The layout must be listed by a referenced master in the same presentation. Attaching a layout does not yet copy placeholder shapes or resolve inherited text formatting. Theme editing is not supported.

This is a foundation, not full PowerPoint support. Parameterless slide creation requires an existing blank layout (included in newly created presentations). The layout overload can select other layout types. Existing slide content and unsupported related parts are retained, but high-level text boxes, pictures, tables, charts, notes, rendering, and animation APIs are not yet implemented. Strict OOXML and macro-enabled presentation formats are not supported.

System Requirement

.NET 8, .NET 10

.NET Standard 2.1 (.NET Core 3.x, .NET 5, .NET 6)

.NET Standard 2.0 (.NET Core 2.x)

.NET Framework 4.0 and above

Contributors

For detailed contributors list, you are read here

Flag Counter

About

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.

Topics

Resources

Security policy

Stars

6.2k stars

Watchers

276 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages