# 使用 Java 去除 PPT 注释

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

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



## Java去除PPT评论

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

### 从 PPT 中删除批注 - Java

```java

Presentation presentation = new Presentation("example.ppt");
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去除PPT中的评论

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

使用 Presentation 类的实例加载 PPT

遍历加载 PPT 的所有作者

删除作者的所有评论

最后删除所有作者

## 其他支持的注释格式
