使用 Python 從 PPTX 移除註解和註解作者

使用 Aspose.Slides for Python via .NET 移除簡報註解及其相關作者。

透過 Python 從 PPTX 移除註解

Aspose.Slides for Python via .NET 可存取 PPTX 簡報中儲存的註解和註解作者。使用 Presentation 載入檔案,清空每位作者的 comments 集合,清空 comment_authors,然後以 PPTX 格式儲存結果。

使用 Python 從 PPTX 移除註解

with slides.Presentation("presentation.pptx") as presentation:
    for comment_author in presentation.comment_authors:
        comment_author.comments.clear()

    presentation.comment_authors.clear()
    presentation.save("presentation-without-comments.pptx", slides.export.SaveFormat.PPTX)

如何透過 Python 從 PPTX 移除註解

依照下列步驟,從 PPTX 簡報中移除所有註解和註解作者。

  1. 安裝 Aspose.Slides for Python via .NET。
  2. 使用 Presentation 開啟 PPTX 檔案。
  3. 逐一處理 comment_authors 並清空每位作者的 comments 集合。
  4. 清空 comment_authors 集合。
  5. 使用 SaveFormat.PPTX 呼叫 save,寫入更新後的 PPTX 簡報。

以 Aspose.Slides 建置

線上移除 PPTX 註解

免費的 Aspose.Slides Annotation 應用程式以 Aspose.Slides for Python via .NET 建置,與上方程式碼使用的是同一個 API。開啟它,看看 API 能如何處理您自己的 PPTX 檔案。

  • 在瀏覽器中執行,無需安裝任何軟體。
  • 在撰寫程式碼之前,先了解 Aspose.Slides 如何移除註解。
  • 移除 PPTX 檔案中的所有註解。
  • 下載清理後的檔案。

註解支援的其他格式

使用 Python,您也可以從其他格式移除註解。