PPT PPTX ODP POT ppsx
Aspose.Slides  for Python via .NET
PPT

Python を使用して PPT プロパティを編集します

独自の Python アプリを構築して、サーバー側 API を使用してプレゼンテーション ファイルの組み込みおよびカスタム プロパティを変更します。

Python 経由で PPT プロパティを変更します

Aspose.Slides for Python via .NET を使用すると、開発者は組み込みプロパティとカスタム プロパティの値にアクセスして変更できます。開発者は、プレゼンテーション オブジェクトによって公開される DocumentProperties プロパティを使用して、プレゼンテーション ファイルのドキュメント プロパティにアクセスできます。

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


import aspose.slides as slides

# Instantiate the Presentation class that represents the Presentation
with slides.Presentation(path + "ModifyBuiltinProperties.ppt") as presentation:
    # Create a reference to object associated with Presentation
    documentProperties = presentation.document_properties

    # Set the builtin properties
    documentProperties.author = "Aspose.Slides for Python"
    documentProperties.title = "Modifying Presentation Properties"
    documentProperties.subject = "Aspose Subject"
    documentProperties.comments = "Aspose Description"
    documentProperties.manager = "Aspose Manager"

    # save your presentation to a file
    presentation.save("DocumentProperties_out.ppt", slides.export.SaveFormat.PPT)

カスタム プロパティを PPT - Python に追加


import aspose.slides as slides

# Instantiate the Presentation class
with slides.Presentation() as presentation:
    # Getting Document Properties
    documentProperties = presentation.document_properties

    # Adding Custom properties
    documentProperties.set_custom_property_value("New Custom", 12)
    documentProperties.set_custom_property_value("My Nam", "Aspose Metadata Editor")
    documentProperties.set_custom_property_value("Custom", 124)

    # Getting property name at particular index
    getPropertyName = documentProperties.get_custom_property_name(2)

    # Removing selected property
    documentProperties.remove_custom_property(getPropertyName)

    # Saving presentation
    presentation.save("CustomDocumentProperties_out.ppt", slides.export.SaveFormat.PPT)

Python 経由で PPT のメタデータを抽出する方法

これらは、PPT ファイルからメタデータを抽出する手順です。

  1. PPT ファイルへのパスを使用してプレゼンテーション クラスをインスタンス化する

  2. プレゼンテーションに関連付けられた DocumentProperties オブジェクトを取得する

  3. DocumentProperties オブジェクト内のアイテムをループする

  4. カスタム プロパティへのアクセスと変更

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

Python を使用すると、他の多くの形式のメタデータを操作することもできます。