PPT PPTX ODP POT ppsx
Aspose.Slides  for Java
PPS

使用 Java 編輯 PPS 屬性

構建您自己的 Java 應用程序,以使用服務器端 API 修改演示文稿文件中的內置和自定義屬性。

通過 Java 修改 PPS 屬性

使用 Aspose.Slides for Java,開發人員可以訪問和修改內置屬性以及自定義屬性的值。開發人員可以使用 Presentation 對象公開的 DocumentProperties 屬性來訪問演示文件的文檔屬性。

修改 PPS 內置屬性 - Java


Presentation pres = new Presentation("Presentation.pps");
try {
    // Create a reference to IDocumentProperties object associated with Presentation
    IDocumentProperties dp = pres.getDocumentProperties();
    
    // Set the built-in properties
    dp.setAuthor("Aspose.Slides for Java");
    dp.setTitle("Modifying Presentation Properties");
    dp.setSubject("Aspose Subject");
    dp.setComments("Aspose Description");
    dp.setManager("Aspose Manager");
    
    // Save your presentation to a file
    pres.save("DocProps.pps", SaveFormat.Pps);
} finally {
    if (pres != null) pres.dispose();
}

將自定義屬性添加到 PPS - Java


Presentation pres = new Presentation();
try {
    // Getting Document Properties
    IDocumentProperties dProps = pres.getDocumentProperties();
    
    // Adding Custom properties
    dProps.set_Item("New Custom", 12);
    dProps.set_Item("My Name", "Aspose Metadata Editor");
    dProps.set_Item("Custom", 124);
    
    // Getting property name at particular index
    String getPropertyName = dProps.getCustomPropertyName(2);
    
    // Removing selected property
    dProps.removeCustomProperty(getPropertyName);
    
    // Saving presentation
    pres.save("CustomDemo.pps", SaveFormat.Pps);
} finally {
    if (pres != null) pres.dispose();
}

如何通過 Java 提取 PPS 的元數據

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

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

  2. 獲取與 Presentation 關聯的 DocumentProperties 對象

  3. 遍歷 DocumentProperties 對像中的項目

  4. 訪問和修改自定義屬性

其他支持的元數據格式

使用 Java,您還可以操作許多其他格式的元數據,包括。