PPT PPTX ODP POT ppsx
Aspose.Slides  for C++
PPS

使用 C++ 编辑 PPS 属性

构建您自己的 C++ 应用程序,以使用服务器端 API 修改演示文稿文件中的内置和自定义属性。

通过 C++ 修改 PPS 属性

使用 Aspose.Slides for C++,开发人员可以访问和修改内置属性以及自定义属性的值。开发人员可以使用 Presentation 对象公开的 DocumentProperties 属性来访问演示文件的文档属性。

修改 PPS 内置属性 - C++


// Instantiate the Presentation class that represents the Presentation
System::SharedPtr<Presentation> presentation = System::MakeObject<Presentation>(u"presentation.pps");

// Create a reference to IDocumentProperties object associated with Presentation
System::SharedPtr<IDocumentProperties> documentProperties = presentation->get_DocumentProperties();

// Set the builtin properties
documentProperties->set_Author(u"New Author");
documentProperties->set_Title(u"New Title");

// Save your presentation to a file
presentation->Save(u"DocumentProperties_out.pps", SaveFormat::Pps);

将自定义属性添加到 PPS - C++


// Instantiate the Presentation class
auto presentation = System::MakeObject<Presentation>();

// Getting Document Properties
auto documentProperties = presentation->get_DocumentProperties();

// Adding Custom properties
documentProperties->idx_set(u"New Custom", ObjectExt::Box<int32_t>(12));
documentProperties->idx_set(u"My Name", ObjectExt::Box<String>(u"Aspose Metadata Editor"));
documentProperties->idx_set(u"Custom", ObjectExt::Box<int32_t>(124));

// Getting property name at particular index
String getPropertyName = documentProperties->GetCustomPropertyName(2);

// Removing selected property
documentProperties->RemoveCustomProperty(getPropertyName);

// Saving presentation
presentation->Save(u"CustomDocumentProperties_out.pps", SaveFormat::Pps);

如何通过 C++ 提取 PPS 的元数据

这些是从 PPS 文件中提取元数据的步骤。

  1. 使用 PPS 文件的路径实例化 Presentation 类

  2. 获取与 Presentation 关联的 DocumentProperties 对象

  3. 遍历 DocumentProperties 对象中的项目

  4. 访问和修改自定义属性

其他支持的元数据格式

使用 C++,您还可以操作许多其他格式的元数据,包括。