使用 Java 編輯 PPS 屬性

建置使用伺服器端 API 修改簡報檔案內建屬性與自訂屬性的 Java 應用程式。

透過 Java 修改 PPS 屬性

透過 Aspose.Slides for Java ,開發人員可以存取和修改簡報的內建屬性與自訂屬性。使用 Presentation 物件的 getDocumentProperties 方法存取簡報檔案的 IDocumentProperties 物件。

修改 PPS 內建屬性 - Java

Presentation presentation = new Presentation("Presentation.pps");
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.pps", SaveFormat.Pps);
} finally {
    presentation.dispose();
}

為 PPS 新增自訂屬性 - 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.pps", SaveFormat.Pps);
} finally {
    presentation.dispose();
}

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

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

  1. 使用 Presentation 類別載入 PPS 檔案。
  2. 呼叫 getDocumentProperties 方法取得 IDocumentProperties 物件。
  3. 讀取或更新 Author、Title、Subject 和 Comments 等內建屬性。
  4. 使用 set_Item、getCustomPropertyName 和 removeCustomProperty 存取和修改自訂屬性。

以 Aspose.Slides 建置

線上檢視和編輯 PPS 中繼資料

免費的 Aspose.Slides Metadata 應用程式以 Aspose.Slides for Java 建置,與上方程式碼使用的是同一個 API。開啟它,看看 API 能如何處理您自己的 PPS 檔案。

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

其他支援的中繼資料格式

使用 Java,也可以管理下列格式的中繼資料。