透過 C++ 修改 PPS 屬性
透過 Aspose.Slides for C++,無需 Microsoft PowerPoint 即可讀取和更新 PPS 檔案的中繼資料。使用 Presentation::get_DocumentProperties 提供的
DocumentProperties
物件變更 Author 和 Title 等內建屬性,或使用 idx_set、GetCustomPropertyName 和 RemoveCustomProperty 管理自訂屬性。
修改 PPS 內建屬性 - C++
auto presentation = MakeObject<Presentation>(u"presentation.pps");
auto documentProperties = presentation->get_DocumentProperties();
documentProperties->set_Author(u"New Author");
documentProperties->set_Title(u"New Title");
presentation->Save(u"updated-presentation.pps", SaveFormat::Pps);
presentation->Dispose();為 PPS 新增自訂屬性 - C++
auto presentation = MakeObject<Presentation>(u"presentation.pps");
auto documentProperties = presentation->get_DocumentProperties();
documentProperties->idx_set(u"Department", ObjectExt::Box<String>(u"Sales"));
documentProperties->idx_set(u"Project", ObjectExt::Box<String>(u"Metadata Update"));
documentProperties->idx_set(u"Revision", ObjectExt::Box<int32_t>(3));
auto customPropertyName = documentProperties->GetCustomPropertyName(2);
documentProperties->RemoveCustomProperty(customPropertyName);
presentation->Save(u"updated-custom-properties.pps", SaveFormat::Pps);
presentation->Dispose();如何在 C++ 中檢視或編輯 PPS 中繼資料
依照下列步驟檢視或編輯 PPS 中繼資料。
- 使用
Presentation類別載入 PPS 檔案。 - 使用
get_DocumentProperties取得DocumentProperties物件。 - 讀取或更新
Author和Title等內建屬性。 - 使用
idx_set、GetCustomPropertyName和RemoveCustomProperty新增、讀取或移除自訂屬性。
以 Aspose.Slides 建置
線上檢視和編輯 PPS 中繼資料
免費的 Aspose.Slides Metadata 應用程式以 Aspose.Slides for C++ 建置,與上方程式碼使用的是同一個 API。開啟它,看看 API 能如何處理您自己的 PPS 檔案。
- 在瀏覽器中執行,無需安裝任何軟體。
- 在撰寫程式碼之前,先看看 Aspose.Slides 如何讀寫屬性。
- 檢視和編輯 PPS 檔案的內建屬性與自訂屬性。
- 儲存並下載更新後的檔案。
其他支援的中繼資料格式
使用 C++,也可以管理下列格式的中繼資料。