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,您还可以操作许多其他格式的元数据,包括。