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++,您還可以操作許多其他格式的元數據,包括。