# 使用 Python 查看或編輯 PPS 文件元數據

> Python 源代碼，用於編輯或查看 PPS 格式元數據。

Source: https://products.aspose.com/slides/zh-hant/python-net/metadata/pps/
Updated: 2023-04-25



## 通過 Python 修改 PPS 屬性

使用 Aspose.Slides for Python via .NET，開發人員可以訪問和修改內置屬性以及自定義屬性的值。開發人員可以使用 Presentation 對象公開的 [DocumentProperties](https://reference.aspose.com/slides/python-net/aspose.slides/documentproperties/) 屬性來訪問演示文件的文檔屬性。

### 修改 PPS 內置屬性 - Python

```py

import aspose.slides as slides

# Instantiate the Presentation class that represents the Presentation
with slides.Presentation(path + "ModifyBuiltinProperties.pps") as presentation:
    # Create a reference to object associated with Presentation
    documentProperties = presentation.document_properties

    # Set the builtin properties
    documentProperties.author = "Aspose.Slides for Python"
    documentProperties.title = "Modifying Presentation Properties"
    documentProperties.subject = "Aspose Subject"
    documentProperties.comments = "Aspose Description"
    documentProperties.manager = "Aspose Manager"

    # save your presentation to a file
    presentation.save("DocumentProperties_out.pps", slides.export.SaveFormat.PPS)
```

### 將自定義屬性添加到 PPS - Python

```py

import aspose.slides as slides

# Instantiate the Presentation class
with slides.Presentation() as presentation:
    # Getting Document Properties
    documentProperties = presentation.document_properties

    # Adding Custom properties
    documentProperties.set_custom_property_value("New Custom", 12)
    documentProperties.set_custom_property_value("My Nam", "Aspose Metadata Editor")
    documentProperties.set_custom_property_value("Custom", 124)

    # Getting property name at particular index
    getPropertyName = documentProperties.get_custom_property_name(2)

    # Removing selected property
    documentProperties.remove_custom_property(getPropertyName)

    # Saving presentation
    presentation.save("CustomDocumentProperties_out.pps", slides.export.SaveFormat.PPS)
```

## 如何通過 Python 提取 PPS 的元數據

這些是從 PPS 文件中提取元數據的步驟。

使用 PPS 文件的路徑實例化 Presentation 類

獲取與 Presentation 關聯的 DocumentProperties 對象

遍歷 DocumentProperties 對像中的項目

訪問和修改自定義屬性

## 其他支持的元數據格式
