/SlideDotNet

A lightweight .NET library for parse PowerPoint file presentations without Microsoft Office installed

Primary LanguageC#MIT LicenseMIT

SlideDotNet

License NuGet

SlideDotNet is a fluent wrapper around Open XML SDK for the processing of PowerPoint files without Microsoft Office installed. It aims to provide an intuitive and user-friendly interface to dealing with the underlying Open XML SDK API.

Getting Started

You can quickly start work with the library by following steps listed below.

Prerequisites

  • .NET Core 2.2 or above

Installing

To install SlideDotNet, run the following command in the Package Manager Console:

PM> Install-Package SlideDotNet

Usage

// opens presentation from the file path
using var presentation = new PresentationEx(@"c:\test.pptx");

// gets the slides collection
var slides = presentation.Slides; 

// gets number of slides
var numSlides = slides.Count(); 

// gets the shapes collection of the first slide
var shapes = slides[0].Shapes;

// prints texts of shapes on the Debug console
foreach (var sp in shapes)
{
    if (sp.HasTextFrame)
    {
        Debug.WriteLine(sp.TextFrame.Text);
    }
}

Changelog

Version 0.4.0 - 2020-03-28

Added

  • Added setters for X, Y, Width and Height properties of non-placeholder shapes;
  • Added ShapeEx.IsGrouped boolean property to determine whether the shape is grouped;
  • Added APIs to remove table row
    var tableRows = shape.Table.Rows;
    // remove by index
    tableRows.RemoveAt(0);
    // remove by instance
    var row = tableRows.First();
    tableRows.Remove(row);
    

To find out more, please check out the CHANGELOG.

Contribution

If you have any problems or questions you can create an issue on this repository or contact me at theadamo86@gmail.com. If you want to contribute in improving this wrapper, feel free to create pull requests.

Author

Adam Shakhabovadamshakhabov