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

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

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



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

 ในการแยกวิเคราะห์ไฟล์ PPTX เราจะใช้
 [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

```

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

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

โหลดไฟล์ PPTX

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

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

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

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

แสดงข้อความ

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

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

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

### แยกไฟล์ PPTX - C++

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

// Load the PPTX 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 PPTX extension are presentation files created with popular Microsoft PowerPoint application. Unlike the previous version of presentation file format PPT which was binary, the PPTX format is based on the Microsoft PowerPoint open XML presentation file format. 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](https://products.aspose.com/slides/th/cpp/parser/odp/) — รูปแบบการนำเสนอ OpenDocument
- [PPT](https://products.aspose.com/slides/th/cpp/parser/ppt/) — Microsoft PowerPoint 97-2003
