# Java を使用して POTM ファイルのメタデータを表示または編集する

> Java ソース コードで、POTM 形式のメタデータを編集または表示できます。

Source: https://products.aspose.com/slides/ja/java/metadata/potm/
Updated: 2023-04-25



## Java 経由で POTM プロパティを変更します

Aspose.Slides for Java を使用すると、開発者は組み込みプロパティとカスタム プロパティの値にアクセスして変更できます。開発者は、プレゼンテーション オブジェクトによって公開される [DocumentProperties](https://reference.aspose.com/slides/java/com.aspose.slides/documentproperties/) プロパティを使用して、プレゼンテーション ファイルのドキュメント プロパティにアクセスできます。

### POTM 組み込みプロパティの変更 - Java

```java

Presentation pres = new Presentation("Presentation.potm");
try {
    // Create a reference to IDocumentProperties object associated with Presentation
    IDocumentProperties dp = pres.getDocumentProperties();

    // Set the built-in properties
    dp.setAuthor("Aspose.Slides for Java");
    dp.setTitle("Modifying Presentation Properties");
    dp.setSubject("Aspose Subject");
    dp.setComments("Aspose Description");
    dp.setManager("Aspose Manager");

    // Save your presentation to a file
    pres.save("DocProps.potm", SaveFormat.Potm);
} finally {
    if (pres != null) pres.dispose();
}
```

### カスタム プロパティを POTM - Java に追加

```java

Presentation pres = new Presentation();
try {
    // Getting Document Properties
    IDocumentProperties dProps = pres.getDocumentProperties();

    // Adding Custom properties
    dProps.set_Item("New Custom", 12);
    dProps.set_Item("My Name", "Aspose Metadata Editor");
    dProps.set_Item("Custom", 124);

    // Getting property name at particular index
    String getPropertyName = dProps.getCustomPropertyName(2);

    // Removing selected property
    dProps.removeCustomProperty(getPropertyName);

    // Saving presentation
    pres.save("CustomDemo.potm", SaveFormat.Potm);
} finally {
    if (pres != null) pres.dispose();
}
```

## Java 経由で POTM のメタデータを抽出する方法

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

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

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

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

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

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