Examine Presentation - C++ PowerPoint API

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

Check 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 C++ code:

auto info = PresentationFactory::get_Instance()->GetPresentationInfo(u"pres.pptx");
// PPTX
Console::WriteLine(ObjectExt::ToString(info->get_LoadFormat()));

auto info2 = PresentationFactory::get_Instance()->GetPresentationInfo(u"pres.ppt");
// PPT
Console::WriteLine(ObjectExt::ToString(info2->get_LoadFormat()));

auto info3 = PresentationFactory::get_Instance()->GetPresentationInfo(u"pres.odp");
// ODP
Console::WriteLine(ObjectExt::ToString(info3->get_LoadFormat()));

Get a Presentation Properties

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

auto info = PresentationFactory::get_Instance()->GetPresentationInfo(u"pres.pptx");
auto props = info->ReadDocumentProperties();
Console::WriteLine(ObjectExt::ToString(props->get_CreatedTime()));
Console::WriteLine(props->get_Subject());
Console::WriteLine(props->get_Title());
// .. 

Update a Presentation Properties

Aspose.Slides provides the PresentationInfo::UpdateDocumentProperties() method that allows you to make changes to a presentation’s properties.

This C++ code shows you how to edit a presentation’s properties:

auto info = PresentationFactory::get_Instance()->GetPresentationInfo(u"pres.pptx");

auto props = info->ReadDocumentProperties();
props->set_Title(u"My title");
info->UpdateDocumentProperties(props);

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