Examine Presentation

Aspose.Slides for .NET allows you to examine a presentation to find out its properties and understand its behavior.

Checking a Presentation Format

Before working on a presentation, you may want to find out what format (PPT, PPTX, ODP, and others) the presentation is in at the moment.

You can check a presentation’s format without loading the presentation. See this sample code:

IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo("pres.pptx");
Console.WriteLine(info.LoadFormat); // PPTX

IPresentationInfo info2 = PresentationFactory.Instance.GetPresentationInfo("pres.ppt");
Console.WriteLine(info2.LoadFormat); // PPT

IPresentationInfo info3 = PresentationFactory.Instance.GetPresentationInfo("pres.odp");
Console.WriteLine(info3.LoadFormat); // ODP

Getting the Properties of a Presentation

This sample code in C# shows you how to get a presentation’s properties (information about the presentation):

IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo("pres.pptx");
IDocumentProperties props = info.ReadDocumentProperties();
Console.WriteLine(props.CreatedTime);
Console.WriteLine(props.Subject);
Console.WriteLine(props.Title);
// .. 

Updating the Properties of a Presentation

Aspose.Slides provides the PresentationInfoUpdateDocumentProperties method that allows you to make changes to a presentation’s properties.

This sample code shows you how to edit the properties for a presentation in C#:

IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo("pres.pptx");

IDocumentProperties props = info.ReadDocumentProperties();
props.Title = "My title";
info.UpdateDocumentProperties(props);

To get more information about a presentation and its security attributes, you may find these links useful: