C++ で OTP のメタデータを編集

Aspose.Slides for C++ を使用して、プレゼンテーション ファイルの組み込みプロパティとカスタム プロパティを表示、更新します。

C++ で OTP のプロパティを変更

Aspose.Slides for C++ を使用すると、Microsoft PowerPoint なしで OTP ファイルのメタデータを読み取り、更新できます。Presentation::get_DocumentProperties が返す DocumentProperties オブジェクトを使用して、Author や Title などの組み込みプロパティを変更したり、idx_set、GetCustomPropertyName、RemoveCustomProperty でカスタム プロパティを管理したりできます。

OTP の組み込みプロパティの変更 - C++

auto presentation = MakeObject<Presentation>(u"presentation.otp");
auto documentProperties = presentation->get_DocumentProperties();

documentProperties->set_Author(u"New Author");
documentProperties->set_Title(u"New Title");

presentation->Save(u"updated-presentation.otp", SaveFormat::Otp);
presentation->Dispose();

OTP へのカスタム プロパティの追加 - C++

auto presentation = MakeObject<Presentation>(u"presentation.otp");
auto documentProperties = presentation->get_DocumentProperties();

documentProperties->idx_set(u"Department", ObjectExt::Box<String>(u"Sales"));
documentProperties->idx_set(u"Project", ObjectExt::Box<String>(u"Metadata Update"));
documentProperties->idx_set(u"Revision", ObjectExt::Box<int32_t>(3));

auto customPropertyName = documentProperties->GetCustomPropertyName(2);
documentProperties->RemoveCustomProperty(customPropertyName);

presentation->Save(u"updated-custom-properties.otp", SaveFormat::Otp);
presentation->Dispose();

C++ で OTP のメタデータを表示または編集する方法

次の手順に従って、OTP のメタデータを表示または編集します。

  1. Presentation クラスで OTP ファイルを読み込みます。
  2. get_DocumentProperties で DocumentProperties オブジェクトを取得します。
  3. Author や Title などの組み込みプロパティを読み取るか更新します。
  4. idx_set、GetCustomPropertyName、RemoveCustomProperty でカスタム プロパティを追加、読み取り、削除します。

Aspose.Slides で構築

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

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

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

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

C++ では次の形式のメタデータも管理できます。