通过 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++,还可以管理以下格式的元数据。