Python で PPT のメタデータを表示、編集

Aspose.Slides を使用して、プレゼンテーションの組み込みプロパティとカスタム プロパティを読み取り、変更する Python アプリを構築します。

Python で PPT のメタデータを表示、変更

Aspose.Slides for Python via .NET を使用すると、PPT プレゼンテーションの組み込みメタデータを読み取って更新し、カスタム ドキュメント プロパティを追加、更新、削除できます。Presentation.document_properties から IDocumentProperties オブジェクトにアクセスして変更し、プレゼンテーションを PPT 形式で保存します。

PPT の組み込みプロパティの更新 - Python

with slides.Presentation("presentation.ppt") as presentation:
    document_properties = presentation.document_properties
    document_properties.author = "Aspose.Slides for Python"
    document_properties.title = "Quarterly Review"
    document_properties.subject = "Presentation Metadata"
    document_properties.comments = "Built-in properties updated with Aspose.Slides."
    document_properties.manager = "Project Manager"

    presentation.save("presentation_with_updated_metadata.ppt", slides.export.SaveFormat.PPT)

PPT のカスタム プロパティの追加と削除 - Python

with slides.Presentation("presentation.ppt") as presentation:
    document_properties = presentation.document_properties
    document_properties.set_custom_property_value("Department", "Engineering")
    document_properties.set_custom_property_value("Review Count", 3)
    document_properties.set_custom_property_value("Obsolete Status", "Draft")
    document_properties.remove_custom_property("Obsolete Status")

    presentation.save("presentation_with_custom_metadata.ppt", slides.export.SaveFormat.PPT)

Python で PPT のメタデータを編集する方法

次の手順に従って、PPT ファイルのメタデータを編集します。

  1. Presentation で PPT ファイルを開きます。
  2. Presentation.document_properties から IDocumentProperties オブジェクトにアクセスします。
  3. 組み込みプロパティを更新するか、カスタム プロパティには set_custom_property_value と remove_custom_property を使用します。
  4. Presentation.save と SaveFormat.PPT でプレゼンテーションを保存します。

Aspose.Slides で構築

PPT のメタデータをオンラインで表示、編集

無料の Aspose.Slides Metadata アプリは、上記のコードと同じ API である Aspose.Slides for Python via .NET で構築されています。アプリを開いて、ご自身の PPT ファイルで API に何ができるかをお確かめください。

  • ブラウザーで動作し、インストールは不要です。
  • コードを書く前に、Aspose.Slides がプロパティをどう読み書きするかを確認できます。
  • PPT ファイルの組み込みプロパティとカスタム プロパティを表示、編集できます。
  • 更新したファイルを保存してダウンロードできます。

その他のサポートされているメタデータ形式

Python では、サポートされている他のプレゼンテーション形式のメタデータも管理できます。