Java で POT のプロパティを編集
サーバー側 API を使用して、プレゼンテーション ファイルの組み込みプロパティとカスタム プロパティを変更する Java アプリを構築します。
Java で POT のプロパティを変更
Aspose.Slides for Java
を使用すると、開発者はプレゼンテーションの組み込みプロパティとカスタム プロパティにアクセスして変更できます。Presentation オブジェクトの getDocumentProperties メソッドを使用して、プレゼンテーション ファイルの IDocumentProperties オブジェクトにアクセスします。
POT の組み込みプロパティの変更 - Java
Presentation presentation = new Presentation("Presentation.pot");
try {
IDocumentProperties documentProperties = presentation.getDocumentProperties();
documentProperties.setAuthor("Aspose.Slides for Java");
documentProperties.setTitle("Modifying Presentation Properties");
documentProperties.setSubject("Aspose Subject");
documentProperties.setComments("Aspose Description");
documentProperties.setManager("Aspose Manager");
presentation.save("DocProps.pot", SaveFormat.Pot);
} finally {
presentation.dispose();
}POT へのカスタム プロパティの追加 - Java
Presentation presentation = new Presentation();
try {
IDocumentProperties documentProperties = presentation.getDocumentProperties();
documentProperties.set_Item("New Custom", 12);
documentProperties.set_Item("My Name", "Aspose Metadata Editor");
documentProperties.set_Item("Custom", 124);
String customPropertyName = documentProperties.getCustomPropertyName(2);
documentProperties.removeCustomProperty(customPropertyName);
presentation.save("CustomDemo.pot", SaveFormat.Pot);
} finally {
presentation.dispose();
}Java で POT のメタデータを表示または編集する方法
次の手順に従って、POT のメタデータを表示または編集します。
PresentationクラスでPOTファイルを読み込みます。getDocumentPropertiesメソッドを呼び出してIDocumentPropertiesオブジェクトを取得します。Author、Title、Subject、Commentsなどの組み込みプロパティを読み取るか更新します。set_Item、getCustomPropertyName、removeCustomPropertyでカスタム プロパティにアクセスして変更します。
Aspose.Slides で構築
POT のメタデータをオンラインで表示、編集
無料の Aspose.Slides Metadata アプリは、上記のコードと同じ API である Aspose.Slides for Java で構築されています。アプリを開いて、ご自身の POT ファイルで API に何ができるかをお確かめください。
- ブラウザーで動作し、インストールは不要です。
- コードを書く前に、Aspose.Slides がプロパティをどう読み書きするかを確認できます。
- POT ファイルの組み込みプロパティとカスタム プロパティを表示、編集できます。
- 更新したファイルを保存してダウンロードできます。
その他のサポートされているメタデータ形式
Java では次の形式のメタデータも管理できます。