How to fetch speaker notes from powerpoint using an API

373 Views Asked by At

I want to fetch a pptx from web and then grab the speaker notes of each slide. Is there an API that allows me to that?

Google Slides already provides that in their API here: https://developers.google.com/slides/api/reference/rest/v1/presentations/get

For powerpoint I've seen they have Javascript API, but it seems just for add-ins. Other option I've seen seems to be OpenXML SDK. Wondered what is the preferred approach?

2

There are 2 best solutions below

0
On

Aspose.Slides makes it easy to get speaker notes from a presentation. This library can be used in C#, Java, C++ and Python. The following C# code example shows you how to get the speaker notes from each slide:

using var presentation = new Presentation("example.pptx");

foreach (var slide in presentation.Slides)
{
    // Get notes from the slide.
    var slideNotes = slide.NotesSlideManager.NotesSlide.NotesTextFrame.Text;
    Console.WriteLine(slideNotes);
}

This is a paid product, but you can get a temporary license to evaluate all its features. Alternatively, you can use Aspose.Slides Cloud SDK that provides REST-based APIs in many languages. The C# code example below shows you how to do the same using Aspose.Slides Cloud:

var slidesApi = new SlidesApi("my_client_key", "my_client_secret");

// A presentation saved in storage.
var fileName = "example.pptx";

var slideCount = slidesApi.GetSlides(fileName).SlideList.Count;
for (var slideNumber = 1; slideNumber <= slideCount; slideNumber++)
{
    // Get notes from the slide.
    var notesSlide = slidesApi.GetNotesSlide(fileName, slideNumber);
    Console.WriteLine(notesSlide.Text);
}

This is also a paid product, but you can make 150 free API calls per month for your purposes. I work as a Support Developer at Aspose.

0
On

If you deal with open XML documents only (*.pptx) you can use the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office for more information.

OfficeJS is for web add-ins only and not designed for standalone applications.