# แยกข้อความและรูปภาพจากเอกสาร ODP ผ่าน C++

> โค้ดตัวอย่าง C++ สำหรับดึงข้อความและรูปภาพจากไฟล์ ODP บน C++ Runtime Environment สำหรับ Windows 32 บิต, Windows 64 บิต และ Linux 64 บิต

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



## วิธีแยกวิเคราะห์ไฟล์ ODP โดยใช้ C++

 ในการแยกวิเคราะห์ไฟล์ ODP เราจะใช้
 [Aspose.Slides สำหรับ C++](https://products.aspose.com/slides/th/cpp/)
 API ซึ่งเป็น API การแยกวิเคราะห์เอกสารที่มีประสิทธิภาพและใช้งานง่ายสำหรับแพลตฟอร์ม C++ คุณสามารถดาวน์โหลดเวอร์ชันล่าสุดได้โดยตรง เพียงแค่เปิด
 [NuGet](https://www.nuget.org/packages/aspose.slides)
 package manager ค้นหา
 **Aspose.Slides.Cpp**
 และติดตั้ง คุณยังสามารถใช้คำสั่งต่อไปนี้จาก Package Manager Console

### สั่งการ

```cs

PM> Install-Package Aspose.Slides.Cpp

```

## ขั้นตอนในการแยกวิเคราะห์ไฟล์ ODP ใน C++

การแยกวิเคราะห์เอกสารพื้นฐานด้วย [Aspose.Slides for C++](https://products.aspose.com/slides/th/cpp/) API สามารถทำได้โดยใช้โค้ดเพียงไม่กี่บรรทัด

โหลดไฟล์ ODP

รับอาร์เรย์ของวัตถุ ITextFrame ของสไลด์แรก

วนรอบอาร์เรย์ของ TextFrames

วนซ้ำย่อหน้าใน ITextFrame ปัจจุบัน

วนซ้ำบางส่วนใน I Paragraph ปัจจุบัน

แสดงข้อความ

## ความต้องการของระบบ

 Aspose.Slides สำหรับ C ++ รองรับบนแพลตฟอร์มหลักและระบบปฏิบัติการทั้งหมด โปรดตรวจสอบให้แน่ใจว่าคุณมีข้อกำหนดเบื้องต้นดังต่อไปนี้

- Microsoft Windows หรือ OS ที่เข้ากันได้กับ C++ Runtime Environment สำหรับ Windows 32 บิต, Windows 64 บิต และ Linux 64 บิต
- Aspose.Slides สำหรับ C ++ DLL ที่อ้างอิงในโครงการของคุณ

### แยกไฟล์ 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 สำหรับ 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/th/cpp/parser/ppt/) — Microsoft PowerPoint 97-2003
- [PPTX](https://products.aspose.com/slides/th/cpp/parser/pptx/) — เปิดรูปแบบการนำเสนอ XML
