使用 C++ 从 ODP 中删除评论和评论作者

构建 C++ 应用,使用服务器端 API 处理演示文稿文件中的评论和作者。

通过 C++ 从 ODP 中删除评论

使用 Aspose.Slides for C++ 从 ODP 演示文稿中删除评论和评论作者。以下示例先清除 get_CommentAuthors 中每位作者的评论,再清空评论作者集合。

从 ODP 中删除批注 – C++

auto presentation = MakeObject<Presentation>(u"example.odp");

// Delete all comments from the presentation.
for (auto author : presentation->get_CommentAuthors())
{
    author->get_Comments()->Clear();
}

// Delete all authors.
presentation->get_CommentAuthors()->Clear();

presentation->Save(u"output.odp", SaveFormat::Odp);
presentation->Dispose();

如何通过 C++ 从 ODP 中删除评论

按照以下步骤从 ODP 演示文稿中删除评论和评论作者。

  1. 安装 Aspose.Slides for C++。请参阅安装。
  2. 使用 Presentation 类加载 ODP 文件。
  3. 遍历 get_CommentAuthors 中的评论作者。
  4. 使用 get_Comments()->Clear() 清除每位作者的评论。
  5. 清空评论作者集合。
  6. 使用 SaveFormat::Odp 保存更新后的演示文稿。

基于 Aspose.Slides 构建

在线删除 ODP 评论

免费的 Aspose.Slides Annotation 应用基于 Aspose.Slides for C++ 构建,与上方代码使用的是同一 API。打开它,看看 API 能如何处理您自己的 ODP 文件。

  • 在浏览器中运行,无需安装任何软件。
  • 在编写代码之前,先了解 Aspose.Slides 如何删除评论。
  • 删除 ODP 文件中的所有评论。
  • 下载清理后的文件。

批注支持的其他格式

使用 C++,您还可以从其他格式中删除批注。