# C++を介してODPドキュメントからテキストと画像を抽出します

> Windows 32ビット、Windows 64ビット、およびLinux64ビット用のC++ランタイム環境でODPファイルからテキストと画像を抽出するためのC++サンプルコード。

Source: https://products.aspose.com/slides/ja/cpp/parser/odp/
Updated: 2026-08-11



## C++を使用してODPファイルを解析する方法

 ODPファイルを解析するために、
 [Aspose.Slides for C ++](https://products.aspose.com/slides/ja/cpp)
 機能が豊富で強力で使いやすいC++プラットフォーム用のドキュメント解析APIであるAPI。最新バージョンを直接ダウンロードできます。開くだけです。
 [NuGet](https://www.nuget.org/packages/aspose.slides)
 パッケージマネージャー、検索
 ** Aspose.Slides.Cpp **
 とインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。

### 指示

```cs

PM> Install-Package Aspose.Slides.Cpp

```

## C++でODPファイルを解析する手順

[Aspose.Slides for C ++](https://products.aspose.com/slides/ja/cpp)APIを使用した基本的なドキュメントの解析は、わずか数行のコードで実行できます。

ODPファイルをロードします。

最初のスライドのITextFrameオブジェクトの配列を取得します。

TextFramesの配列をループします

現在のITextFrameの段落をループします。

現在のIParagraphの部分をループします。

テキストを表示します。

## システム要求

 Aspose.Slides for C ++は、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。次の前提条件があることを確認してください。

-MicrosoftWindowsまたはWindows32ビット、Windows 64ビット、Linux64ビット用のC++ランタイム環境と互換性のあるOS。
-プロジェクトで参照されているC++DLLのAspose.Slides。

### ODPファイルの解析-C++

```cs
// Sample file path
const String sourceFilePath = u"SourcePath\sourceFile.odp";

// Load the ODP file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);

// Get an Array of ITextFrame objects from the first slide
System::ArrayPtr<SharedPtr<ITextFrame>> textFramesSlideOne = SlideUtil::GetAllTextBoxes(presentation->get_Slides()->idx_get(0));

// Loop through the Array of TextFrames
for (int i = 0; i get_Length(); i++){
	// Loop through paragraphs in current ITextFrame
	for (SharedPtr<IParagraph> paragraph : textFramesSlideOne[i]->get_Paragraphs()){
		// Loop through portions in the current IParagraph
		for (SharedPtr<IPortion> portion : paragraph->get_Portions()){
			// Display text
			Console::WriteLine(portion->get_Text());
		}
	}
}

```

## Aspose.Slides for C++APIについて

 Aspose.Slides APIを使用して、Microsoft PowerPointドキュメントの読み取り、書き込み、操作、およびPDF、XPS、HTML、TIFF、ODP、その他のさまざまな形式への変換を行うことができます。新しいファイルを最初から作成し、サポートされている関連する形式で保存できます。 Aspose.Slidesは、プレゼンテーション、スライド、要素を作成、解析、または操作するためのスタンドアロンAPIであり、MicrosoftやOpenOfficeなどのソフトウェアに依存しません。

Files with ODP extension represent presentation file format used by OpenOffice.org in the OASISOpen standard. A presentation file is a collection of slides where each slide can comprise of text, images, formatting, animations, and other media. These slides are presented to audience in the form of slideshows with custom presentation settings. ODP files can be opened by applications that conform to the OpenDocument format (such as OpenOffice or StarOffice).

## その他のサポートされている解析ドキュメント

- [PPT](https://products.aspose.com/slides/ja/cpp/parser/ppt/) — Microsoft PowerPoint 97-2003
- [PPTX](https://products.aspose.com/slides/ja/cpp/parser/pptx/) — XMLプレゼンテーション形式を開く
