使用 Python 查看和编辑 PPS 元数据

构建使用 Aspose.Slides 读取和修改演示文稿内置属性与自定义属性的 Python 应用程序。

使用 Python 查看和修改 PPS 元数据

借助 Aspose.Slides for Python via .NET ,可以读取和更新 PPS 演示文稿的内置元数据,并添加、更新或删除自定义文档属性。通过 Presentation.document_properties 访问 IDocumentProperties 对象,修改后将演示文稿保存为 PPS 格式。

更新 PPS 内置属性 - Python

with slides.Presentation("presentation.pps") as presentation:
    document_properties = presentation.document_properties
    document_properties.author = "Aspose.Slides for Python"
    document_properties.title = "Quarterly Review"
    document_properties.subject = "Presentation Metadata"
    document_properties.comments = "Built-in properties updated with Aspose.Slides."
    document_properties.manager = "Project Manager"

    presentation.save("presentation_with_updated_metadata.pps", slides.export.SaveFormat.PPS)

添加和删除 PPS 自定义属性 - Python

with slides.Presentation("presentation.pps") as presentation:
    document_properties = presentation.document_properties
    document_properties.set_custom_property_value("Department", "Engineering")
    document_properties.set_custom_property_value("Review Count", 3)
    document_properties.set_custom_property_value("Obsolete Status", "Draft")
    document_properties.remove_custom_property("Obsolete Status")

    presentation.save("presentation_with_custom_metadata.pps", slides.export.SaveFormat.PPS)

如何使用 Python 编辑 PPS 元数据

按照以下步骤编辑 PPS 文件的元数据。

  1. 使用 Presentation 打开 PPS 文件。
  2. 通过 Presentation.document_properties 访问其 IDocumentProperties 对象。
  3. 更新内置属性,或对自定义属性使用 set_custom_property_value 和 remove_custom_property。
  4. 使用 Presentation.save 和 SaveFormat.PPS 保存演示文稿。

基于 Aspose.Slides 构建

在线查看和编辑 PPS 元数据

免费的 Aspose.Slides Metadata 应用基于 Aspose.Slides for Python via .NET 构建,与上方代码使用的是同一 API。打开它,看看 API 能如何处理您自己的 PPS 文件。

  • 在浏览器中运行,无需安装任何软件。
  • 在编写代码之前,先看看 Aspose.Slides 如何读写属性。
  • 查看和编辑 PPS 文件的内置属性与自定义属性。
  • 保存并下载更新后的文件。

其他支持的元数据格式

使用 Python,还可以管理其他受支持演示文稿格式的元数据。