# 使用 Java 檢視或編輯 PPSX 檔案中繼資料

> 在 Java 中檢視和編輯 PPSX 中繼資料。使用 Aspose.Slides for Java 更新簡報的內建屬性與自訂屬性。

Source: https://products.aspose.com/slides/zh-hant/java/metadata/ppsx/
Updated: 2026-10-25



## 透過 Java 修改 PPSX 屬性

透過 [Aspose.Slides for Java](/slides/zh-hant/java/)，開發人員可以存取和修改簡報的內建屬性與自訂屬性。使用 `Presentation` 物件的 `getDocumentProperties` 方法存取簡報檔案的 `IDocumentProperties` 物件。

### 修改 PPSX 內建屬性 - Java

```java
Presentation presentation = new Presentation("Presentation.ppsx");
try {
    IDocumentProperties documentProperties = presentation.getDocumentProperties();

    documentProperties.setAuthor("Aspose.Slides for Java");
    documentProperties.setTitle("Modifying Presentation Properties");
    documentProperties.setSubject("Aspose Subject");
    documentProperties.setComments("Aspose Description");
    documentProperties.setManager("Aspose Manager");

    presentation.save("DocProps.ppsx", SaveFormat.Ppsx);
} finally {
    presentation.dispose();
}
```

### 為 PPSX 新增自訂屬性 - Java

```java
Presentation presentation = new Presentation();
try {
    IDocumentProperties documentProperties = presentation.getDocumentProperties();

    documentProperties.set_Item("New Custom", 12);
    documentProperties.set_Item("My Name", "Aspose Metadata Editor");
    documentProperties.set_Item("Custom", 124);

    String customPropertyName = documentProperties.getCustomPropertyName(2);
    documentProperties.removeCustomProperty(customPropertyName);

    presentation.save("CustomDemo.ppsx", SaveFormat.Ppsx);
} finally {
    presentation.dispose();
}
```

## 如何在 Java 中檢視或編輯 PPSX 中繼資料

依照下列步驟檢視或編輯 PPSX 中繼資料。

1. 使用 `Presentation` 類別載入 `PPSX` 檔案。

1. 呼叫 `getDocumentProperties` 方法取得 `IDocumentProperties` 物件。

1. 讀取或更新 `Author`、`Title`、`Subject` 和 `Comments` 等內建屬性。

1. 使用 `set_Item`、`getCustomPropertyName` 和 `removeCustomProperty` 存取和修改自訂屬性。

## 線上檢視和編輯 PPSX 中繼資料

免費的 Aspose.Slides Metadata 應用程式以 [Aspose.Slides for Java](https://products.aspose.com/slides/zh-hant/java/) 建置，與上方程式碼使用的是同一個 API。開啟它，看看 API 能如何處理您自己的 PPSX 檔案。

- 在瀏覽器中執行，無需安裝任何軟體。
- 在撰寫程式碼之前，先看看 Aspose.Slides 如何讀寫屬性。
- 檢視和編輯 PPSX 檔案的內建屬性與自訂屬性。
- 儲存並下載更新後的檔案。

## 其他支援的中繼資料格式
