# 使用 Java 删除 ODP 注解

> 用于在 JSP/JSF 应用程序和桌面应用程序的 Java 运行时环境中删除 ODP 格式注释的 Java 示例代码。

Source: https://products.aspose.com/slides/zh/java/annotation/odp/
Updated: 2023-04-18



## 通过 Java 从 ODP 中删除评论

为了从 ODP 文件中删除注释，我们将使用 [Aspose.Slides for Java](https://products.aspose.com/slides/zh/java/) API，它功能丰富、功能强大且易于使用用于 Java 平台的文档操作 API。

### 从 ODP 中删除注解 - Java

```java

Presentation presentation = new Presentation("example.odp");
try {
    // Deletes all comments from the presentation
    for (ICommentAuthor author : presentation.getCommentAuthors())
    {
        author.getComments().clear();
    }

    // Deletes all authors
    presentation.getCommentAuthors().clear();

    presentation.save("example_out.pptx", SaveFormat.Pptx);
} finally {
    if (presentation != null) presentation.dispose();
}
```

## 如何通过 Java 从 ODP 中删除评论

安装**Aspose.Slides for Java**。请参阅 [**安装**](https://docs.aspose.com/slides/java/installation/)。

使用 Presentation 类的实例加载 ODP

遍历加载的 ODP 的所有作者

删除作者的所有评论

最后删除所有作者

## 其他支持的注释格式
