This article demonstrates how to add, update and remove speaker notes in PowerPoint using the NotesSlidesApi interface provided by Spire.Cloud.PowerPoint.
Add speaker notes
using Spire.Cloud.Powerpoint.Sdk.Client;
using Spire.Cloud.Powerpoint.Sdk.Api;
namespace AddSpeakerNotes
{
class Program
{
static string appId = "APP ID";
static string appKey = "APP Key";
static string baseUrl = "https://api.cloudxdocs.com";
//Create a Configuration instance based on your AppID and AppKey
static Configuration configuration = new Configuration(appId, appKey, baseUrl);
//Create a NotesSlidesApi instance
static NotesSlidesApi notesSlidesApi = new NotesSlidesApi(configuration);
static void Main(string[] args)
{
//Specify the input document
string name = "sample.pptx";
//Specify the index of the slide
int slideIndex = 0;
//Specify the text of speaker notes
string note = "Tips for making effective presentations.";
//Specify the password used to open the document, and it's "null" if nothing
string password = null;
//Use the 2G storage provided by E-iceblue, and it's "null" by default
string storage = null;
//Specify the folder storing the input document, and it's "null" if nothing
string folder = "input";
//Call AddNotesSlide method to add speaker notes to the slide
notesSlidesApi.AddNotesSlide(name, slideIndex, note, password, folder, storage);
}
}
}
Output:
Update speaker notes
using Spire.Cloud.Powerpoint.Sdk.Client;
using Spire.Cloud.Powerpoint.Sdk.Api;
namespace UpdateSpeakerNotes
{
class Program
{
static string appId = "APP ID";
static string appKey = "App Key";
static string baseUrl = "https://api.cloudxdocs.com";
//Create a Configuration instance based on your AppID and AppKey
static Configuration configuration = new Configuration(appId, appKey, baseUrl);
//Create a NotesSlidesApi instance
static NotesSlidesApi notesSlidesApi = new NotesSlidesApi(configuration);
static void Main(string[] args)
{
//Specify the input document
string name = "sample.pptx";
//Specify the index of the slide
int slideIndex = 0;
//Specify the text of speaker notes
string note = "Updated speaker notes";
//Specify the password used to open the document, and it's "null" if nothing
string password = null;
//Use the 2G storage provided by E-iceblue, and it's "null" by default
string storage = null;
//Specify the folder storing the input document, and it's "null" if nothing
string folder = "input";
//Call SetNotesSlide method to update text of speaker notes in the slide
notesSlidesApi.SetNotesSlide(name, slideIndex, note, password, folder, storage);
}
}
}
Output:
Remove speaker notes
using Spire.Cloud.Powerpoint.Sdk.Client;
using Spire.Cloud.Powerpoint.Sdk.Api;
namespace RemoveSpeakerNotes
{
class Program
{
static string appId = "APP ID";
static string appKey = "APP Key";
static string baseUrl = "https://api.cloudxdocs.com";
//Create a Configuration instance based on your AppID and AppKey
static Configuration configuration = new Configuration(appId, appKey, baseUrl);
//Create a NotesSlidesApi instance
static NotesSlidesApi notesSlidesApi = new NotesSlidesApi(configuration);
static void Main(string[] args)
{
//Specify the input document
string name = "sample.pptx";
//Specify the index of the slide
int slideIndex = 0;
//Specify the password used to open the document, and it's "null" if nothing
string password = null;
//Use the 2G storage provided by E-iceblue, and it's "null" by default
string storage = null;
//Specify the folder storing the input document, and it's "null" if nothing
string folder = "input";
//Call DeleteNotesSlide method to remove speaker notes in the slide
notesSlidesApi.DeleteNotesSlide(name, slideIndex, password, folder, storage);
}
}
}
Output: